Jump to content

Entering TP marker doesn't work


marty000123

Recommended Posts

Hi.

 
 marker = createMarker(-2712.5,217.6,4, "corona", 1,255,255,0)
	function teleport(player)
if getElementType(player)=="player" then
local vehicle=getPedOccupiedVehicle(player)
if source == marker then
setElementPosition(vehicle, -2722, 207, -9)
setElementFrozen(vehicle, true)
setTimer(setElementFrozen, 1000, 1, vehicle, false)
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), teleport) 

The point of this script is to TP the player and it's vehicle to the given setElementPosition. A friend of mine made this, but we couldn't figure out why it doesn't work. When you get into the marker, you should get TP'd to the wanted destination, but it doesn't, it doesn't TP you anywhere. It doesn't work while on foot and it doesn't work when you're in a vehicle. Again, help would be very appreciated!

Marty

Edited by marty000123
Link to comment
 marker = createMarker ( -2712.5,217.6,4,'corona',1,255,255,0 )
 addEventHandler ( 'onClientMarkerHit',marker,
function ( aPlayer )
    if aPlayer == localPlayer then
            local aMove = getPedOccupiedVehicle ( aPlayer ) or aPlayer
            setElementPosition ( aMove,-2722,207,-9 )
            setElementFrozen ( aMove,true )
            setTimer ( setElementFrozen,1000,1,aMove,false )
        end
    end
)

Try this.

Link to comment
11 hours ago, iPrestege said:

 marker = createMarker ( -2712.5,217.6,4,'corona',1,255,255,0 )
 addEventHandler ( 'onClientMarkerHit',marker,
function ( aPlayer )
    if aPlayer == localPlayer then
            local aMove = getPedOccupiedVehicle ( aPlayer ) or aPlayer
            setElementPosition ( aMove,-2722,207,-9 )
            setElementFrozen ( aMove,true )
            setTimer ( setElementFrozen,1000,1,aMove,false )
        end
    end
)

Try this.

Hi, thanks for the help. Sadly, it didn't work. It didn't give me a warning/error in debugscript 3, but it just doesn't want to RP me or my car.

http://imgur.com/a/D9OGY

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...