summaryrefslogtreecommitdiff
path: root/examples.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples.lua')
-rw-r--r--examples.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples.lua b/examples.lua
index 8f0ff67..69950fe 100644
--- a/examples.lua
+++ b/examples.lua
@@ -12,6 +12,21 @@ playereffects.register_effect_type("high_speed", "High speed", nil, {"speed"},
end
)
+-- Makes the user faster (hidden effect)
+playereffects.register_effect_type("high_speed_hidden", "High speed", nil, {"speed"},
+ function(player)
+ player:set_physics_override(4,nil,nil)
+ end,
+
+ function(effect)
+ local player = minetest.get_player_by_name(effect.playername)
+ player:set_physics_override(1,nil,nil)
+ end,
+ true
+)
+
+
+
-- Slows the user down
playereffects.register_effect_type("low_speed", "Low speed", nil, {"speed"},
function(player)
@@ -69,6 +84,14 @@ minetest.register_chatcommand("fast", {
playereffects.apply_effect_type("high_speed", 10, minetest.get_player_by_name(name))
end,
})
+minetest.register_chatcommand("hfast", {
+ params = "",
+ description = "Makes you fast for a short time (hidden effect).",
+ privs = {},
+ func = function(name, param)
+ playereffects.apply_effect_type("high_speed_hidden", 10, minetest.get_player_by_name(name))
+ end,
+})
minetest.register_chatcommand("slow", {
params = "",
description = "Makes you slow for a long time.",