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

text changer else problem help?

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

4 comments

0

Also you spaced you function......

0

Just gotta add that because it might cause some problems in your script

0

also "connect' is deprecated

0

Spaced function won't cause any problems

2 answers

✓ Accepted answer

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)

1 comment

0

You don't need to change anything on this script just copy and paste it

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