Jump to content

TelePort Error


iFoReX

Recommended Posts

I created a market and work but when Im inside of market I dont teleport

here my code .lua

local x = 685.62610 
local y = -2692.39307 
local z = 7.5 
  
local market = createMarker ( x, y, z,  "cylinder", 1.5, 0, 0, 255, 170 ) 
  
function markerHit (hitPlayer) 
    if ( hitPlayer == localPlayer ) then 
setElementPosition(0,0,0) 
  
    end 
end 
addEventHandler ("onClientMarkerHit", market, markerHit) 

Link to comment
local x = 685.62610 
local y = -2692.39307 
local z = 7.5 
  
local market = createMarker ( x, y, z,  "cylinder", 1.5, 0, 0, 255, 170 ) 
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
            setElementPosition ( player, 0, 0, 0 ); 
        end 
    end 
) 

Link to comment

try this

local x = 685.62610 
local y = -2692.39307 
local z = 7.5 
  
local market = createMarker ( x, y, z,  "cylinder", 1.5, 0, 0, 255, 170 ) 
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
           setTimer(setElementPosition, 1000, 1, player, 0, 0, 0 ); --- After 1 second 
        end 
    end 
) 

Link to comment

thnx mans It work now This is my script

.lua

local x = 685.62610 
local y = -2692.39307 
local z = 7.5 
local x2 = 294.38306 
local y2 = -167.90103 
local z2 = 1.57813  
  
local market = createMarker ( x, y, z,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local market2 = createMarker ( x2 + 2, y2, z2 - 1,  "cylinder", 1.5, 0, 0, 255, 170 ) 
  
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
        setTimer(setElementPosition, 2000, 1, player, x2, y2, z2 ); 
        elseif ( player == localPlayer and source == market2 ) then 
        setTimer(setElementPosition, 2000, 1, player, x + 2, y + 2, z + 2 ); 
        end 
    end 
) 

But , can help me with this ? I want only my name can teleport in 1 market , can help me please ?

Link to comment

what is bad ?

local x = 685.62610 
local y = -2692.39307 
local z = 7.5 
local x2 = 294.38306 
local y2 = -167.90103 
local z2 = 1.57813  
  
local market = createMarker ( x, y, z,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local market2 = createMarker ( x2 + 2, y2, z2 - 1,  "cylinder", 1.5, 0, 0, 255, 170 ) 
  
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
local name = getPlayerName(player) 
            if name == "ElMota" then 
        if ( player == localPlayer and source == market ) then 
        setTimer(setElementPosition, 2000, 1, player, x2, y2, z2 ); 
        elseif ( player == localPlayer and source == market2 ) then 
        setTimer(setElementPosition, 2000, 1, player, x + 2, y + 2, z + 2 ); 
        end 
    end 
) 

Link to comment

ty this :

  
local x = 685.62610 
local y = -2692.39307 
local z = 7.5 
local x2 = 294.38306 
local y2 = -167.90103 
local z2 = 1.57813 
  
local market = createMarker ( x, y, z,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local market2 = createMarker ( x2 + 2, y2, z2 - 1,  "cylinder", 1.5, 0, 0, 255, 170 ) 
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
local name = getPlayerName(player) 
            if name == "ElMota" then 
        if ( player == localPlayer and source == market ) then 
        setTimer(setElementPosition, 2000, 1, player, x2, y2, z2 ); 
        elseif ( player == localPlayer and source == market2 ) then 
        setTimer(setElementPosition, 2000, 1, player, x + 2, y + 2, z + 2 ); 
        end 
    end 
end 
) 

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