Bean666 Posted May 27, 2016 Share Posted May 27, 2016 Hello. whenever a player hits the marker, it shows for all players, anyway to fix this? it's clientside. function menuShow() visibleornot = guiGetVisible (window) if (visibleornot == true) then guiSetVisible (window, false) showCursor (false) end if (visibleornot == false) then guiSetVisible (window, true) showCursor (true) end end for k,v in ipairs( spots ) do marker = createMarker ( v[1],v[2],v[3], "Cylinder", 1.5, 255, 255, 255, 50 ) addEventHandler ("onClientMarkerHit", marker, menuShow) end Link to comment
roaddog Posted May 27, 2016 Share Posted May 27, 2016 Add a check to see if element is localPlayer. Link to comment
Bean666 Posted May 27, 2016 Author Share Posted May 27, 2016 for k,v in ipairs( spots ) do marker = createMarker ( v[1],v[2],v[3], "Cylinder", 1, 255, 255, 255, 100 ) function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then guiSetVisible(window, true) showCursor(true) end end addEventHandler ( "onClientMarkerHit", marker, MarkerHit ) end this seems simplier, it works but will it show for other players too? i think not. Link to comment
Rataj Posted May 27, 2016 Share Posted May 27, 2016 That should work, but don't put your function definition inside loop. Try it like this: function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then guiSetVisible(window, true) showCursor(true) end end for k,v in ipairs( spots ) do marker = createMarker ( v[1],v[2],v[3], "Cylinder", 1, 255, 255, 255, 100 ) addEventHandler ( "onClientMarkerHit", marker, MarkerHit ) end 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