w3rt1x Posted December 18, 2022 Share Posted December 18, 2022 I need to give money on server client code: local marker = createMarker(-699.07342529297, 955.33538818359, 11, "cylinder", 2, 255, 255, 0, 170) function giveMoney(hitPlayer, matchingDimension) if hitPlayer == localPlayer then outputChatBox("Okey it's your money") end end addEventHandler("onClientMarkerHit", marker, giveMoney) Link to comment
Shady1 Posted December 18, 2022 Share Posted December 18, 2022 (edited) 9 minutes ago, w3rt1x said: I need to give money on server client code: local marker = createMarker(-699.07342529297, 955.33538818359, 11, "cylinder", 2, 255, 255, 0, 170) function giveMoney(hitPlayer, matchingDimension) if hitPlayer == localPlayer then outputChatBox("Okey it's your money") end end addEventHandler("onClientMarkerHit", marker, giveMoney) welcome to the forum, i made a code for you, i didn't test it, you should try this --client function giveMoney(hitPlayer, matchingDimension) if hitPlayer == localPlayer then outputChatBox("Okey it's your money") triggerServerEvent("giveMoney", hitPlayer, 1000) --enter amount here end end addEventHandler("onClientMarkerHit", marker, giveMoney) --server addEvent("giveMoney", true) addEventHandler("giveMoney", root, function(amount) givePlayerMoney(client, amount) end ) Edited December 18, 2022 by Shady1 1 Link to comment
w3rt1x Posted December 18, 2022 Author Share Posted December 18, 2022 thank you! 4 minutes ago, Shady1 said: welcome to the forum, i made a code for you, i didn't test it, you should try this --client function giveMoney(hitPlayer, matchingDimension) if hitPlayer == localPlayer then outputChatBox("Okey it's your money") triggerServerEvent("giveMoney", hitPlayer , 1000) --enter amount here end end addEventHandler("onClientMarkerHit", marker, giveMoney) --server addEvent("giveMoney", true) addEventHandler("giveMoney", root, function(amount) givePlayerMoney(client, amount) end ) it's working Link to comment
Shady1 Posted December 18, 2022 Share Posted December 18, 2022 you're welcome, if you have any new questions please create a new topic and tag me 1 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