scolen Posted June 27, 2023 Share Posted June 27, 2023 This is a script I made. This has been working fine so far and then suddenly stopped working. What is the reason for it? addEvent("startMinerJob", true) function startJob(thePlayer) if not (getElementData(thePlayer, "Jobs") == "miner") then setElementData(thePlayer, "Jobs", "miner") setElementData(thePlayer, "copper", getElementData(thePlayer, "copper")) end mineMarker = createMarker(596.22632, 926.04364, -37.97111, "cylinder", 10.0) addEventHandler("onMarkerHit", mineMarker, function() playerWeapon = getPlayerWeapon(thePlayer) if playerWeapon == 23 then outputChatBox("test", thePlayer) setPedFrozen(thePlayer, true) setTimer(function() setPedAnimation(thePlayer, "SWORD", "sword_4", -1, false, false, false, false) end, 1000, 5) setTimer( function() outputChatBox("relesed", thePlayer) setPedFrozen(thePlayer, false) setElementData(thePlayer, "copper", getElementData(thePlayer, "copper")+3) end , 5000, 1) end end) end addEventHandler("startMinerJob", root, startJob) --[[ Leave Miner Job Section ]] addEvent("leaveMinerJob", true) function leaveJob(thePlayer) if (getElementData(thePlayer, "Jobs") == "miner") then setElementData(thePlayer, "Jobs", nil) outputChatBox("you leaved miner job!", thePlayer, 0, 255, 0) end end addEventHandler("leaveMinerJob", root, leaveJob) --[[ Job Testing Section ]] function test(thePlayer) de = getElementData(thePlayer, "copper") outputChatBox("you have "..de.." coppers") end addCommandHandler("gg", test) Link to comment
Trust aka Tiffergan Posted July 2, 2023 Share Posted July 2, 2023 can you show errors from 'debugscript 3' ? 1 Link to comment
scolen Posted July 2, 2023 Author Share Posted July 2, 2023 12 hours ago, Trust aka Tiffergan said: can you show errors from 'debugscript 3' ? lol.. I have put it in the weapon id 23 so that it works only if you have it in hand. I didn't remember it at the time. my bad Link to comment
FallenGod Posted July 13, 2023 Share Posted July 13, 2023 Bro getPlayerWeapon Was Deprecated And You Can Replac it with getPedWeapon (https://wiki.multitheftauto.com/wiki/GetPlayerWeapon) Or You Can type upgrade resource-name On Your Consol 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