Hello, I have been recently trying to code a script that simply removes I gui that a :insert script creates abruptly in my game. I cannot understand this issue clearly.
My code:
local players = game:GetService("Players")
player = players.LocalPlayer
players.PlayerAdded:Connect(function(player)
wait(1)
if player ~= nil then
local a = player:FindFirstChild("PlayerGui")
local b = a:WaitForChild("MuteButtonGui") -- Infinite yield, look at screenshot though!
b.Enabled = false
end
end)
This is most likely I simply issue I cannot wrap my head around haha!

4 comments
Check if there is a space behind MuteButtonGui name example "MuteButtonGui "
Sadly not
Is this done in a LocalScript or ServerScript?
Is this a local script?