Sign in to follow this  

Drug transport

Recommended Posts

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 ) 
addEventHandler( "onMarkerHit", markerLS, JobDoneLS )


Share this post

Link to post

Just thinking logically wouldn't it be better to destroy and create it client sided?

Edited by ViRuZGamiing

Share this post

Link to post

^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.

  • Like 1

Share this post

Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.