openwf/Scripts/samples/Freecam Teleport on Disable.pluto
2025-10-06 18:27:00 +08:00

17 lines
416 B
Plaintext

local was_in_freecam = false
local last_pos
repeat
if avatar := gRegion:GetLocalPlayerAvatar() then
if avatar:isFollowedByCamera() then
if was_in_freecam then
was_in_freecam = false
avatar:SetPosition(last_pos)
end
else
was_in_freecam = gRegion:GetLocalPlayer():isControllingCamera()
if was_in_freecam then
last_pos = gRegion:GetGameCamera():GetPosition()
end
end
end
until yield()