wesleywillems17 Posted December 23, 2016 Share Posted December 23, 2016 Hi all, I have a problem with my drug transport script. I'm trying to make the marker not Visible once the player reach his destination. Everythibng works but i get a error everytime i hit the destination marker. How could i fix this? WARNING: [gameplay]\SRdrugDeliver\server.lua:14: Bad argument @ 'setElementVisibleTo' [Expected element at argument 2] function JobDoneLS(attackerLS) if (attackerLS) and (attackerLS ~= source) then setElementVisibleTo ( markerLS, attackerLS, false ) if isElement(CarLS) then destroyElement ( CarLS ) end end end addEventHandler( "onMarkerHit", markerLS, JobDoneLS ) Link to comment
ViRuZGamiing Posted December 23, 2016 Share Posted December 23, 2016 (edited) Just thinking logically wouldn't it be better to destroy and create it client sided? Edited December 23, 2016 by ViRuZGamiing Link to comment
Mega9 Posted December 23, 2016 Share Posted December 23, 2016 ^that plus are you aware that whenever the next drug delivery is made, that it overwrites all other global variables, making those elements made before basically inaccessible through those variables, therefore even if the destruction is successful, it will only destroy the element from the latest drug delivery. So either store the elements in a table with a unique key which you can later use to access that particular element, or just do it all client-side which is anyway recommended. 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