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

I cannot figure out how to have my textbutton script work. Can someone find a solution?

So what I have planned is that when you click one of the buttons in game, it will uncheck a disabled script in StarterGui. If pressed Fall, the fall script will be unchecked and you should be falling and the fly script is checked. If pressed Fly, the fly script will be unchecked an you should be flying and the fall script is checked. I think I am close to an answer but I can't seem to find it.

function onClick() 
script.Parent.Parent.Fall.Selected = true
script.Parent.Parent.Fly.Selected = false
	if script.Parent.Parent.Fall.Selected == true then
	game.StarterPack.Skydive.Selected = false
	script.Parent.Text = "On"
	end
	if script.Parent.Parent.Fly.Selected == false then
	game.StarterPack.Fly.Selected = true
	script.Parent.Parent.Fly.Text = "Off"
	end

end

script.Parent.MouseButton1Click:connect(onClick)

It will not work when I press the button. Please help me find a solution for it.

1 answer

The word "mouse" should be in the ().

5 comments

0

It still does not work. It doesn't matter if it capitalized or not.

0

Try putting the word "mouse" in the () after onClick. That fixed it with my textbutton.

0

That still doesn't work

0

Ill just figure it out on my own ;-;

0

I figured it out

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