Hi!
I'm a beginner ( fine, call me noob ) at scripting in LUA. I'm trying to make a script for a race server. The script is supposed to make the afk-players have ghostmode on start of maps. I thought the script through as this: GM gets enabled on every map-start. When the client presses "w" or "s", their ghostmode gets turned off. This is what I managed to get and it doesn't give any errors, but it doesn't work either, so if anyone could help me correct it I would appreciate it.
addEvent('onClientMapStarting', true)
function GhostMode()
thePlayer = source
setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false )
if getKeyState( "w" ) == true or getKeyState( "s" ) == true then
setElementData( thePlayer, "overrideCollide.uniqueblah", nil, false )
end
end
addEventHandler('onClientMapStarting', getRootElement(), GhostMode)