mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-23 08:20:21 +01:00
Avoid crash when commandblocks are forced to be used (forceload)
This commit is contained in:
parent
4c0e117706
commit
31c40de110
@ -107,11 +107,16 @@ local function resolve_commands(commands, pos)
|
||||
farthest = player:get_player_name()
|
||||
end
|
||||
end
|
||||
local random = players[math.random(#players)]:get_player_name()
|
||||
commands = commands:gsub("@nearest", nearest)
|
||||
commands = commands:gsub("@farthest", farthest)
|
||||
commands = commands:gsub("@random", random)
|
||||
return commands
|
||||
local randomp = players[math.random(#players)]
|
||||
if randomp then
|
||||
local random = randomp:get_player_name()
|
||||
commands = commands:gsub("@nearest", nearest)
|
||||
commands = commands:gsub("@farthest", farthest)
|
||||
commands = commands:gsub("@random", random)
|
||||
return commands
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
local function commandblock_action_on(pos, node)
|
||||
|
Loading…
Reference in New Issue
Block a user