guiismiti
Well-Known Member
- Joined
- May 19, 2014
- Messages
- 315
- Solutions
- 3
- Reaction score
- 68
Hello again,
I'm trying to add a parameter to my change floor talkaction - I want to be able to go up or down more than once at a time.
This is the code I'm using for the up function, and it's not working, I'm stuck and couldn't find related threads in the forum.
So, /up takes me up one floor, but /up 2 or /up, 2 does not take me anywhere.
Does anybody know why? I've got no errors or warnings from the console.
I'm trying to add a parameter to my change floor talkaction - I want to be able to go up or down more than once at a time.
This is the code I'm using for the up function, and it's not working, I'm stuck and couldn't find related threads in the forum.
Code:
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
local n = 1
if(param ~= '') then
n = math.max(0, tonumber(param))
end
local position = player:getPosition()
position.z = position.z - n
player:teleportTo(position)
return false
end
So, /up takes me up one floor, but /up 2 or /up, 2 does not take me anywhere.
Does anybody know why? I've got no errors or warnings from the console.