#How i can make a custom menu?

20 messages · Page 1 of 1 (latest)

ashen cairn
#

local ReplicatedFirst = game:GetService("ReplicatedFirst")
local TweenService = game:GetService("TweenService")

local Camera = workspace.CurrentCamera
local StarterMenu = script.Parent

-- Pegando a posição inicial da câmera no jogo
local InitialCFrame = Camera.CFrame

local CameraParts = workspace:WaitForChild("CameraParts"):GetChildren()

local CFramePoints = {}
for index, part in ipairs(CameraParts) do
CFramePoints[index] = part.CFrame
end

local function CameraCycle()
Camera.CameraType = Enum.CameraType.Scriptable

while true do
    Camera.CFrame = InitialCFrame
    for _, cframe in ipairs(CFramePoints) do
        local tweeninfo = TweenInfo.new(5)
        local tween = TweenService:Create(Camera, tweeninfo, {CFrame = cframe})
        tween:Play()
        tween.Completed:Wait()
    end

    task.wait()
end

end
CameraCycle()

noble aurora
#

i have a feeling it is

#

considering the camera Cframe is involved

ashen cairn
#

yes

#

but it doesn't work and I don't know why

noble aurora
#

cause theres a useless task.wait() in there. (imo)

ashen cairn
#

I made mine, but it still didn't work, so I asked someone to fix it.

ashen cairn
vernal folioBOT
#

studio** You are now Level 1! **studio

noble aurora
# ashen cairn I made mine, but it still didn't work, so I asked someone to fix it.

thank god u asked them instead of paying them, so basically.

  1. Inf loop (the while true do statement) will cause the script to freeze,

it basically makes it impossible to like make it stop or run other shit.

  1. tween.Completed:Wait() is absolutely dumb. it forces the script to wait for each tween to finish, yeah thats cool but. ** Completed events are unreliable** for tweens. especially if a new tween starts before the old one finishes.

instead why not try tween.Completed:Connect(function() -- text here blah blah blah)

  1. the camera type change might be overwritten. force it to be scriptable before every tween -- idk bout ts one tbh..
ashen cairn
#

ahh

#

I'll try to fix it, thanks for the advice

noble aurora
#

(considering im still an S0.)

ashen cairn
#

brooo, I managed to fix it, thank you very much