Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

attempt to index nil with 'enabled' error?

Hi. im trying to make a script that temporarily disables your chat. This is my code. it is a local script, and the parent of the local script is Player Gui.

x = script.Parent:FindFirstChild("Chat")
wait()
while true do
	if game.Workspace.Current.Value ~= script.Parent.Parent.TeamColor then
		x.Enabled = false
	else
		x.Enabled = true
	end
end

1 answer

Im kinda stupid, i had to put wait for child instead of find first child, and i had to put the wait() in the loop not before

This discussion is preserved as it was. New answers, comments, and votes are closed.