Functions aren't functioning?

Hey there!

For some reason, nothing works in this script. I’ve tried my best searching what’s wrong. But I came up with nothing. So I’m here to ask you people.

Tweening, functions, everything doesn’t work

local spawnlist = script.Parent.Main.SpawnList
local spawnbtn = script.Parent.Main.Spawn.btn
local settingsbtn = script.Parent.Main.Settings.btn
local settingslist = script.Parent.Main.SettingsList

local hoverspawn = spawnbtn.Parent.hover
local hoversetting = settingsbtn.Parent.hover

spawnbtn.MouseButton1Click:Connect(function()
	settingslist:TweenPosition(UDim2.new(-1.1, 0, 0.525, 0),"In","Quad")
	wait(1)
	spawnlist:TweenPosition(UDim2.new(0, 0, 0.525, 0),"In","Quad")
end)

settingsbtn.MouseButton1Click:Connect(function()
	spawnlist:TweenPosition(UDim2.new(-1.1, 0, 0.525, 0),"In","Quad")
	wait(1)
	settingslist:TweenPosition(UDim2.new(0, 0, 0.525, 0),"In","Quad")
end)

Is this in a LocalScript?

I don’t believe server scripts execute inside of GUIs (that or they can’t listen for input events)

Yes, this is in a local script.
I’ve never had this issue. (Just some words so I can reply to you)

Try printing something to test if it works or not.

I tried, printing something to test if it works. But that doesn’t even work.

Found the issue, the issue was that I’ve put a “while true do” loop somewhere above the piece of code. That made it for some reason, the script below it not work.
But anyway, thank you for your help.