TheScriptingNewbie Posted February 20, 2013 Share Posted February 20, 2013 Hello i need some help from scripters here, i want that if i walk into a checkpoint, something changes. Like gives you money or something, i am just not experienced enough and don't know how to script such a thing. Could anybody help me? Link to comment
Baseplate Posted February 20, 2013 Share Posted February 20, 2013 local marker = createMarker(x, y, z, "checkpoint") addEventHandler("onMarkerHit", marker, function(hitElement) if (getElementType(hitElement) == "player") then givePlayerMoney(hitElement, 5000) end end ) Link to comment
tosfera Posted February 20, 2013 Share Posted February 20, 2013 Hello i need some help from scripters here, i want that if i walk into a checkpoint, something changes. Like gives you money or something, i am just not experienced enough and don't know how to script such a thing. Could anybody help me? You can use the client and server side scripting for this. Like, you can make a gui when the player hits the marker(client, server) or give the player money (server), warp him into a car and place them somewhere in the air! (server) The last one will be funny! local marker = createMarker(0,0,5, "cylinder", 2, 0, 255, 0, 150) -- create's the marker addEventHandler("onMarkerHit", root, function ( hitElement ) if ( source == marker ) then -- if he hits the right marker local v = createVehicle(602, 0, 0, 1200) -- create the vehicle warpPedIntoVehicle(hitElement, v) -- warp him into a vehicle outputChatBox("Dont look down!", hitElement) -- tell him that he is fcked! ;3 end end ) Link to comment
TheScriptingNewbie Posted February 20, 2013 Author Share Posted February 20, 2013 Hello i need some help from scripters here, i want that if i walk into a checkpoint, something changes. Like gives you money or something, i am just not experienced enough and don't know how to script such a thing. Could anybody help me? You can use the client and server side scripting for this. Like, you can make a gui when the player hits the marker(client, server) or give the player money (server), warp him into a car and place them somewhere in the air! (server) The last one will be funny! local marker = createMarker(0,0,5, "cylinder", 2, 0, 255, 0, 150) -- create's the marker addEventHandler("onMarkerHit", root, function ( hitElement ) if ( source == marker ) then -- if he hits the right marker local v = createVehicle(602, 0, 0, 1200) -- create the vehicle warpPedIntoVehicle(hitElement, v) -- warp him into a vehicle outputChatBox("Dont look down!", hitElement) -- tell him that he is fcked! ;3 end end ) Thank you, i have another question, what if i want that you get 1000 per 10 seconds if you stand on the point, and when you reach the limit you cant get money anymore, for example : 100000 $? I am not experienced at all, but hey at least i'm learning (if not asking too much). Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now