Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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

Log in to vote
0
Answered by
tber8 37
7 years ago
Edited 7 years ago

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

0
It still does not work. It doesn't matter if it capitalized or not. CardboardedCharacter 53 — 7y
0
Try putting the word "mouse" in the () after onClick. That fixed it with my textbutton. tber8 37 — 7y
0
That still doesn't work CardboardedCharacter 53 — 7y
0
Ill just figure it out on my own ;-; CardboardedCharacter 53 — 7y
0
I figured it out CardboardedCharacter 53 — 7y
Ad

Answer this question