After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
16:03:19.510 Infinite yield possible on ‘Players.ItsMarkStyles.PlayerGui.ScreenGui.Description.Difficulty:WaitForChild(“Meter”)’ - Studio
16:03:19.510 Stack Begin - Studio
16:03:19.510 Script ‘Players.ItsMarkStyles.PlayerGui.ScreenGui.HubMain’, Line 26 - function switch_desc - Studio - HubMain:26
16:03:19.510 Script ‘Players.ItsMarkStyles.PlayerGui.ScreenGui.HubMain’, Line 44 - Studio - HubMain:44
16:03:19.510 Stack End
-- // Written by: @ItsMarkStyles
-- // Info:
-- // Creation date: 02/02/22
local rs = game:GetService('RunService')
local ts = game:GetService('TweenService')
local cam = game.Workspace.CurrentCamera
local worlds = game.Workspace:WaitForChild('Worlds')
local desc = script.Parent:WaitForChild('Description')
local nav = script.Parent:WaitForChild('Navigation')
local cur = 1
local function get_world(id)
for _, v in pairs(worlds:GetChildren()) do
if v.Id.Value == cur then
return v
end
end
return nil
end
local function switch_desc(world)
desc.World.Text = world.WName.Value
desc.Desc.Text = world.Desc.Value
ts:Create(desc.Difficulty:WaitForChild('Meter'), TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {Position = UDim2.new(world.Difficulty.Value, 0,-0.15, 0)}):Play()
end
nav.Right.MouseButton1Click:Connect(function()
if worlds:GetChildren()[cur + 1] then
cur += 1
else
cur = 1
end
switch_desc(get_world(cur))
end)
nav.Left.MouseButton1Click:Connect(function()
if worlds:GetChildren()[cur - 1] then
cur -= 1
else
cur = #worlds:GetChildren()
end
switch_desc(get_world(cur))
end)
rs.RenderStepped:Connect(function()
cam.CameraType = Enum.CameraType.Scriptable
local c = get_world(cur)
if c then
cam.CFrame = c.CamPart.CFrame
end
end)
local c = get_world(cur)
switch_desc(c)
cam.CFrame = c.CamPart.CFrame```