Here's the script
script.Parent.MouseButton1Click:connect( function() if not script.Parent.Text == "On" then script.Parent.Text = "On" elseif not script.Parent.Text == "Off" then script.Parent.Text = "Off" end end)
help please
see if that works
script.Parent.Text = "Off" script.Parent.MouseButton1Click:Connect(function() if script.Parent.Text == "On" then script.Parent.Text = "Off" elseif script.Parent.Text == "Off" then script.Parent.Text = "On" end end)
Just change the variable for it. Normally people don't write not infront of the if statement but instead by the equal sign..
script.Parent.Parent.TextButton.MouseButton1Click:Connect(function() if script.Parent.Text ~= "On" then script.Parent.Text = "On" elseif not script.Parent.Text ~= "Off" then script.Parent.Text = "Off" end end)