Dice Posted March 19, 2013 Posted March 19, 2013 vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) outputChatBox ( "testest.", hitElement, 255, 215, 0, true ) end ) why isn't this working? no errors just out puts nothing!
PaiN^ Posted March 19, 2013 Posted March 19, 2013 What do you want to output ? A player's name, Element type, etc ...
فاّرس Posted March 19, 2013 Posted March 19, 2013 vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) outputChatBox ( "testest.", hitElement, 255, 215, 0, true ) end ) why isn't this working? no errors just out puts nothing! Try this vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) outputChatBox("Test",source,0,255,0,true) end )
Baseplate Posted March 19, 2013 Posted March 19, 2013 (edited) vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", root, function ( hitElement ) if (source == vatoMarker) then outputChatBox("testest.",hitElement,0,255,0,true) end end ) Edited March 19, 2013 by Guest
PaiN^ Posted March 19, 2013 Posted March 19, 2013 @ The Best : The source of the event onMarkerHit is the marker that got hit, Read the wiki first ! @ Dice : if you want the message to appear to every one in the server : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( ) outputChatBox("Test",root,0,255,0,true) end ) And If you want it to appear only for the player that hit the marker : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if getElementType ( hitElement ) == "player" then outputChatBox("Test",hitElement,0,255,0,true) end end )
Baseplate Posted March 19, 2013 Posted March 19, 2013 For the last code @PaiN, then if you hit the marker with a car it won't output anything.
فاّرس Posted March 19, 2013 Posted March 19, 2013 (edited) @ The Best :The source of the event onMarkerHit is the marker that got hit, Read the wiki first ! @ Dice : if you want the message to appear to every one in the server : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( ) outputChatBox("Test",root,0,255,0,true) end ) And If you want it to appear only for the player that hit the marker : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if getElementType ( hitElement ) == "player" then outputChatBox("Test",hitElement,0,255,0,true) end end ) Experience Edited March 19, 2013 by Guest
Baseplate Posted March 19, 2013 Posted March 19, 2013 Speak English here, go speak your native language at the appropriate subforums.
Dice Posted March 19, 2013 Author Posted March 19, 2013 #Pai_[N], it's not working =| what should I do?
PaiN^ Posted March 19, 2013 Posted March 19, 2013 Any errors on debugscript ? * EDIT : For the last code @PaiN, then if you hit the marker with a car it won't output anything. I don't see where he mentioned a car ! @ The Best :The source of the event onMarkerHit is the marker that got hit, Read the wiki first ! @ Dice : if you want the message to appear to every one in the server : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( ) outputChatBox("Test",root,0,255,0,true) end ) And If you want it to appear only for the player that hit the marker : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if getElementType ( hitElement ) == "player" then outputChatBox("Test",hitElement,0,255,0,true) end end ) Experience What so funny ?!
iPrestege Posted March 19, 2013 Posted March 19, 2013 local vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if (getElementType(hitElement) == "player") then outputChatBox ( "testest.", hitElement, 255, 215, 0, true ) end end )
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