tosfera Posted February 19, 2013 Share Posted February 19, 2013 Okee so, this sounds so easy and I've done it before, but I always did it client-sided. This time I'm trying to create a marker with a command ( /sell ), and the only simple thing Im trying right now, is saying a message when a player enters the marker. But somehow, the server sideded script isn't recognising the marker as a proper element... any idea's? addCommandHandler("sell", function ( source ) local x, y, z = getElementPosition ( source ) marker = createMarker(x, y, z-1, "cylinder", 4, 255, 0, 0, 150) end ) function testMarker( hitElement ) outputChatBox("You entered a marker!", source) end addEventHandler("onMarkerHit", getRootElement(), testMarker) I'm doing this server-sided because its going to be like; you want some support? enter this marker and a private message thingy comes up. Just for fun, its like... a trade on other games, but then just walking. Link to comment
tosfera Posted February 19, 2013 Author Share Posted February 19, 2013 Okee so, this sounds so easy and I've done it before, but I always did it client-sided. This time I'm trying to create a marker with a command ( /sell ), and the only simple thing Im trying right now, is saying a message when a player enters the marker. But somehow, the server sideded script isn't recognising the marker as a proper element... any idea's? addCommandHandler("sell", function ( source ) local x, y, z = getElementPosition ( source ) marker = createMarker(x, y, z-1, "cylinder", 4, 255, 0, 0, 150) end ) function testMarker( hitElement ) outputChatBox("You entered a marker!", source) end addEventHandler("onMarkerHit", getRootElement(), testMarker) I'm doing this server-sided because its going to be like; you want some support? enter this marker and a private message thingy comes up. Just for fun, its like... a trade on other games, but then just talking. Link to comment
iPrestege Posted February 19, 2013 Share Posted February 19, 2013 addCommandHandler("sell", function ( source ) local x, y, z = getElementPosition ( source ) marker = createMarker(x, y, z-1, "cylinder", 4, 255, 0, 0, 150) end ) function testMarker( hitElement ) if (getElementType(hitElement) == "player") and ( source == marker ) then outputChatBox("You entered a marker!",hitElement) end end addEventHandler("onMarkerHit", root, testMarker) Link to comment
tosfera Posted February 19, 2013 Author Share Posted February 19, 2013 addCommandHandler("sell", function ( source ) local x, y, z = getElementPosition ( source ) marker = createMarker(x, y, z-1, "cylinder", 4, 255, 0, 0, 150) end ) function testMarker( hitElement ) if (getElementType(hitElement) == "player") and ( source == marker ) then outputChatBox("You entered a marker!",hitElement) end end addEventHandler("onMarkerHit", root, testMarker) Hey thanks man, sorry 'bout yesterday. Trolling isn't the best thing to do at those points but, it kinda worked! Thaanks :3 Link to comment
iPrestege Posted February 19, 2013 Share Posted February 19, 2013 You're Welcome And No Problem About Yesterday . 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