How to fix this help

wanna to get it work but idknow somthing about lua and i try this for server side but not work
sombody know how to fix this script to get it work ?
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustPressed(1,214) than

WaypointHandle = GetFirstBlipInfoId(8)                                
if DoesBlipExist(WaypointHandle) than                        

    Vector3 WaypointPos = GetBlipCoords(WaypointHandle)    
    Handle = GetPlayerPed(-1)    
if IsPedInAnyVehicle(Handle, 0) than
    Handle = GetVehiclePedIsIn(GetPlayerPed(-1), 0)    
    SetEntityCoords(Handle, WaypointPos, 0, 0, 0, 1)

else PRINT("~r~Please set a Waypoint!", 2000)

end
    
        end

    end

end

end)

:joy: … :o no body help :open_mouth:

1 Like

this is the clientside , you don’t need a serverside to manage this

oh ok thankyou but how to get this script work in client just i try in client and this script did not work when i press to teleport nothing happen …

Handle = GetPlayerPed(-1)
Local Handle = GetPlayerPed(-1)
As you set it up like now, Handle is nothing in this script

SetEntityCoords(Handle, WaypointPos, 0, 0, 0, 1)
try make a handle function that will take the x , y and z from the waypoint location .

how u convert this c++ in to lua ?

Blip b = GetFirstBlipInfoId(BLIP_WAYPOINT);
if(DoesBlipExist(b)) {
Vector3 v;
GetBlipCoords(b, &v);
SetCharCoordinates(ped, v.X, v.Y, v.Z);
while(v.Z == 0.0f)
{
GetGroundZFor3DCoord(v.X, v.Y, 1000, &v.Z);
Wait(0);
}
SetCharCoordinates(ped, v.X, v.Y, v.Z);
PrintStringWithLiteralStringNow2(“STRING”, “Teleported to waypoint.”, 1000, 1);
}
else
{
PrintStringWithLiteralStringNow2(“STRING”, “No way point found to teleport to.”, 1000, 1);
}

i need this funtion by pressing any keyboard button than player can teleport to waypoint … cz i want to disabled script function to prevent rom any scammer or bad modder joining server… it will make player can teleport easy to another player…