Hey, im having a problem with destroyElement.
Script is meant to:
1) Give player a box IF pressed E in the appropriate marker ( works. )
2) Using a random function choose a marker where he needs to give it back ( works.)
3) Destroy only element that this player who enters a marker is "holding"
What is wrong? Its server-side. So it destroy each box element that exists in the server and I want to destroy it only for the person that enters the marker. Any ideas how to do this? I was thinking about either using setElementData or tables, but have no idea how to start with this. Here's the code for server- side:
addEvent("GiveThing", true)
addEventHandler("GiveThing", getRootElement(), function(localPlayer)
object = createObject(1518, 0, 0, 0)
attachElements(object, source, 0, 0.5, 0.4)
setObjectScale(object, 0.9)
end)
addEvent("RemoveThing", true)
addEventHandler("RemoveThing", getRootElement(), function(localPlayer)
destroyElement(object)
end)