openwf/Scripts/samples/Freecam Up Down.pluto
2025-10-06 18:27:00 +08:00

19 lines
603 B
Plaintext

-- Modifications to sample scripts will be lost the next time you start the game.
$define VK_CONTROL = 0x11
$define VK_SPACE = 0x20
local Y_STEP <const> = Vector(0, 0.01, 0)
local t = os.millis()
repeat
local delta = os.millis() - t
if gRegion:GetLocalPlayer():isControllingCamera() then
if owf_is_key_down(VK_SPACE) then
gRegion:GetGameCamera():SetPosition(gRegion:GetGameCamera():GetPosition() + Y_STEP * delta)
end
if owf_is_key_down(VK_CONTROL) then
gRegion:GetGameCamera():SetPosition(gRegion:GetGameCamera():GetPosition() - Y_STEP * delta)
end
end
t = os.millis()
until yield()