Hey! I am new on Lua and I was wondering if someone can help me with this. Basically I want the markers hidden when hitting the markers, it works perfectly but the marker can still be selected once any player gets in. I want them to dissapear and also nobody would be able to interact with them.
local act1Marker1 = createMarker(2445.3193359375,2376.3627929688,12.163512229919, "cylinder", 1.0,0,246,255,50)
createBlipAttachedTo(act1Marker1,60)
local act1Marker2 = createMarker(2435.3193359375,2376.3627929688,12.163512229919, "cylinder", 1.0,0,246,255,50)
setElementVisibleTo ( act1Marker2, root, false )
addEventHandler("onMarkerHit",act1Marker1,
function(hitElement,matchingDimension)
triggerClientEvent("showGui", hitElement, hitElement)
end)
function startact1Job(thePlayer)
outputChatBox("Anda al siguiente marker!", hitElement,100,100,100)
setElementVisibleTo ( act1Marker1, root, false)
setElementVisibleTo ( act1Marker2, root, true)
end
addEvent("giveact1Job",true)
addEventHandler("giveact1Job", root, startact1Job)
function MarkerHit54( hitElement, matchingDimension )
outputChatBox("Ganaste!", hitElement,100,100,100)
setElementVisibleTo ( act1Marker1, root, true)
setElementVisibleTo ( act1Marker2, root, false)
end
addEventHandler( "onMarkerHit", act1Marker2, MarkerHit54 )
Thanks in advance!