Hello,
I wrote a function which should warp a player who reaches a checkpoint a few feet higher.
function warphigh (source)
local x, y, z, r = 0, 0, 0, 0
x, y, z = getElementPosition (source)
r = getPlayerRotation (source)
z = (z + 20)
setElementPosition (source, x, y, z)
setPlayerRotation (source, r)
end
addEvent('onPlayerReachCheckpoint')
addEventHandler('onPlayerReachCheckpoint', getRootElement(), warphigh(source))
I run it with,
warphigh(source)
but nothing happens at all, neither error messages nor crashes.
Thanks in advance.