AlexWo Posted April 6, 2014 Share Posted April 6, 2014 Hello, I got a problem with an "If" I want that if an player enters a marker, his Skin will get checked and if his skin is 287 (Army skin) an object will get attached to him. Client Side with the Problem: function attachobjectterror() attachElements ( objecttosteal, localPlayer, 0.5, 0, -0.5 ) setMarkerColor ( attachedmarker, 0, 255, 0, 0 ) end function attachobjectarmy() attachElements ( objecttosteal, localPlayer, 0.5, 0, -0.5 ) setMarkerColor ( attachedmarker, 0, 255, 0, 0 ) end function getModelID(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then theSkin = getElementModel ( getLocalPlayer() ) if (theSkin == 287) then triggerEvent(attachobjectarmy) end end end addEventHandler("onClientMarkerHit", getRootElement(), getModelID) I'm not sure how to solve that Problem... (at line 17) Thank you for helping Link to comment
Dealman Posted April 6, 2014 Share Posted April 6, 2014 triggerEvent(attachobjectarmy) This is the problem. You're trying to trigger a function, not an event. And the event should be a string. Try to replace that with this; attachobjectarmy() Should trigger that function. 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