Jump to content

Help whit teleport when marker hit!


kevenvz

Recommended Posts

Hi, I got a script and I got a bug but can't find it.

It is into a race map.

Here is the script:

justinBieber = createPed ( 240, -3145, 6920, 55.5 ) 
setPedRotation ( justinBiber, 270 ) 
theMarker = createMarker( -3144, 6920 , 56 , "cylinder", 7, 0, 0, 255, 0 ) 
source = getLocalPlayer() 
vehicle = getPlayerOccupiedVehicle(getLocalPlayer()) 
  
function textMessages () 
outputChatBox ("#AAEE62This map is fully green made! No robots!", 27, 89, 224, true) 
outputChatBox ("#FF0000Are you Ready to kill Justin Bieber?", 27, 224, 50, true) 
outputChatBox ("#FF0000I am ready, because he rocks!", 27, 224, 50, true) 
outputChatBox ("#FFFFFFPress #AAEE62'M' #FFFFFFto turn music On/Off", 255, 0, 0, true) 
end  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), textMessages ) 
  
function MarkerHit( hitPlayer, matchingDimension ) 
        setElementPosition(vehicle, -3339.3500976563, 6927.7890625, 55.877330780029 ) 
        setElementVelocity(vehicle, 0, 0, 0) 
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
  

Link to comment

addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit )

getRootElement() must be changed to your marker name!

addEventHandler ( "onClientMarkerHit", theMarker, MarkerHit )

Otherwise it will act on every marker hit.

EDIT: If u want something interact on ResourceStart, you can even let it be there without any function. So it will get

created like a marker or something in your function.

justinBieber = createPed ( 240, -3145, 6920, 55.5 ) 
setPedRotation( justinBiber, 270 ) 
theMarker = createMarker( -3144, 6920 , 56 , "cylinder", 7, 0, 0, 255, 0 ) 
source = getLocalPlayer() 
vehicle = getPlayerOccupiedVehicle(getLocalPlayer()) 
  
    outputChatBox ("#AAEE62This map is fully green made! No robots!", 27, 89, 224, true) 
    outputChatBox ("#FF0000Are you Ready to kill Justin Bieber?", 27, 224, 50, true) 
    outputChatBox ("#FF0000I am ready, because he rocks!", 27, 224, 50, true) 
    outputChatBox ("#FFFFFFPress #AAEE62'M' #FFFFFFto turn music On/Off", 255, 0, 0, true) 
  
function MarkerHit( hitPlayer, matchingDimension ) 
        setElementPosition(vehicle, -3339.3500976563, 6927.7890625, 55.877330780029 ) 
        setElementVelocity(vehicle, 0, 0, 0) 
end 
addEventHandler ( "onClientMarkerHit", theMarker, MarkerHit ) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...