Reduced to single register_on_joinplayer
This commit is contained in:
parent
f29a5f2dbb
commit
013a000fa4
35
init.lua
35
init.lua
@ -33,13 +33,6 @@ minetest.register_chatcommand("hobble", {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
if minetest.get_player_privs(name).hobbled then
|
||||
hobble(name,name)
|
||||
end
|
||||
end)
|
||||
|
||||
--reduces player movement speed
|
||||
local function slowmo(name, param)
|
||||
local player = minetest.get_player_by_name(param)
|
||||
@ -65,13 +58,6 @@ minetest.register_chatcommand("slowmo", {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
if minetest.get_player_privs(name).slowed then
|
||||
slowmo(name,name)
|
||||
end
|
||||
end)
|
||||
|
||||
--disable sneak glitch for the player.
|
||||
local function noglitch(name, param)
|
||||
local player = minetest.get_player_by_name(param)
|
||||
@ -97,13 +83,6 @@ minetest.register_chatcommand("noglitch", {
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
if minetest.get_player_privs(name).unglitched then
|
||||
noglitch(name,name)
|
||||
end
|
||||
end)
|
||||
|
||||
--prevents player from changing speed/direction and jumping.
|
||||
local function freeze(name, param)
|
||||
local player = minetest.get_player_by_name(param)
|
||||
@ -129,13 +108,25 @@ minetest.register_chatcommand("freeze", {
|
||||
end
|
||||
})
|
||||
|
||||
--trigger curse effects when player joins
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
if minetest.get_player_privs(name).hobbled then
|
||||
hobble(name,name)
|
||||
end
|
||||
if minetest.get_player_privs(name).slowed then
|
||||
slowmo(name,name)
|
||||
end
|
||||
if minetest.get_player_privs(name).unglitched then
|
||||
noglitch(name,name)
|
||||
end
|
||||
if minetest.get_player_privs(name).frozen then
|
||||
freeze(name,name)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
--reset player physics.
|
||||
minetest.register_chatcommand("setfree",{
|
||||
params = "<person>",
|
||||
|
Loading…
x
Reference in New Issue
Block a user