Studios
Clouds Loadinghouse-3.jpg

Commands & Exports

FreeClouds LoadingStandalone
PAGE 06 OF 06  ·  TROUBLESHOOTING → COMMANDS & EXPORTSdocs.glitchstudios.dev
Browse docs

Client API#

Teleport(coords, hold)#

Swoops the player from where they are to coords. Leave coords out to go up and come back down on the spot.

exports['glitch-cloudsLoading']:Teleport(vector4(215.8, -810.1, 30.7, 160.0))

TriggerCloudLoadingScreen(from, to, hold)#

Teleports between two locations. If the player is more than 5 metres from from they are placed there first, then swooped to to.

local from = vector3(-1037.7, -2737.8, 20.2)
local to = vector4(1855.1, 3683.5, 34.3, 210.0)
exports['glitch-cloudsLoading']:TriggerCloudLoadingScreen(from, to, 5000)

SkySwoopUp(from) and SkySwoopDown(coords, hold)#

The two halves on their own, for when you want to do something while the player is in the clouds. Both arguments of each are optional.

if exports['glitch-cloudsLoading']:SkySwoopUp() then
    -- the player is above the clouds: load a mission, swap a character, anything
    exports['glitch-cloudsLoading']:SkySwoopDown(vector4(440.8, -981.1, 30.7, 90.0))
end

IsActive()#

Returns true while a transition is running.

The client exports wait until they are done. Teleport, TriggerCloudLoadingScreen and SkySwoopDown return true once the player has landed, SkySwoopUp returns true once the camera is above the clouds. They return false if a transition was already running or the camera could not start. If the camera could not start, the player is still moved to the destination.

Server API#

Same names, with the player's server id first. They return straight away.

exports['glitch-cloudsLoading']:Teleport(source, vector4(215.8, -810.1, 30.7, 160.0))

exports['glitch-cloudsLoading']:TriggerCloudLoadingScreen(source, from, to, 5000)

exports['glitch-cloudsLoading']:SkySwoopUp(source)
exports['glitch-cloudsLoading']:SkySwoopDown(source, coords, hold)

Pass -1 as the id to run it for every player.

Events#

If you would rather not use exports, the server can trigger these on a client:

TriggerClientEvent('cloudsLoading:teleport', source, coords, hold)
TriggerClientEvent('cloudsLoading:trigger', source, from, to, hold)
TriggerClientEvent('cloudsLoading:up', source, from)
TriggerClientEvent('cloudsLoading:down', source, coords, hold)

Test command#

  • /testclouds goes up and down on the spot.
  • /testclouds x y z swoops to those coords.
  • /testclouds x y z x2 y2 z2 goes from the first set to the second.

Add a number on the end of any of them to set the hold time in ms.

Client exports#

Export signature Implementation in your package
IsActive() client.lua
SkySwoopDown(coords, hold) client.lua
SkySwoopUp(coords) client.lua
Teleport(coords, hold) client.lua
TriggerCloudLoadingScreen(startCoords, endCoords, duration) client.lua

Server exports#

Export signature Implementation in your package
SkySwoopDown(playerId, coords, hold) server.lua
SkySwoopUp(playerId, coords) server.lua
Teleport(playerId, coords, hold) server.lua
TriggerCloudLoadingScreen(playerId, startCoords, endCoords, duration) server.lua