Are there tutorials for totally beginners that just started scripting?
look at this crappy 25+ errors script i made, i dont even know what im doing myself
i probably only understanded 2% of the introduction of scripting
-- crappy 25 error+ rpg script
players = getElementsByType ( "player" )
root = getRootElement ()
function spawnPlayer (thePlayer)
local playerSpawnPoint = WHAT SHOULD I PUT HERE
fadeCamera ( source, true )
givePlayerMoney ( player thePlayer, 10000 amount )
end
function onPlayerKill (thePlayer)
playersname= getClientName(source)
outputChatBox("zomfgz bitchass you just killed someone you stupid f***face dmer/cheater your going to be banned!(or you get spawned 10 minutes later)", source)
KillPlayer(source)
setTimer(spawnPlayer, 600000, 1, source)
end
addEventHandler("onPlayerKill", root, onPlayerKill)
function onPlayerJoin ()
playerName = getClientName(source)
outputChatBox("welcome, " .. playerName .. ", you have been given 10000 for joining this server, and DON'T DM because its a RPG server, thank you.", source)
spawnPlayer(source)
end
addEventHandler("onPlayerJoin", root, onPlayerJoin)
function onPlayerDeath ()
outputChatBox("You died! Please wait 10 seconds to respawn", source)
setTimer(spawnPlayer, 10000, 1, source)
end
addEventHandler("onPlayerWasted", root, onPlayerDeath)
what does root mean?
what does (source) mean?