Teleport

Teleporting player to some coordinates

Function parameters:

ParameterTypeDescriptionRequre

playerId

integer

existing player server Id

yes

coords

vector3

spawn coordinates

yes

  • Example:

HRLib = exports.HRLib:getLibFunctions() -- Getting HRLib client or server functions list

-- In client
HRLib.RegCommand('teleportMeSomewhere', function(args, rawCommand, IPlayer)
    HRLib.Teleport(IPlayer.source, vector3(math.random(0, 1000), math.random(0, 1000), math.random(0, 1000), false) -- Teleporting yourself to a random place
end, false)

-- In server
HRLib.RegCommand('teleportMeSomewhere2', false, true, function(args, rawCommand, IPlayer)
    HRLib.Teleport(IPlayer.source, vector3(math.random(0, 1000), math.random(0, 1000), math.random(0, 1000), false) -- Teleporting yourself to a random place
end, false)

Last updated