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

How do you make a hide GUI script, How do you make it so an individual button is hidden?

Asked by 6 years ago
Edited 6 years ago

I am trying to make a hide team select GUI, but It just won't work and I'm very confused.

I am somewhat of a noob, so please go easy on me!

script.textButton.MouseButton1Down:connect(function()
script.Parent,click.play()
    script.Parent.Text = "Show"
    script.Parent.Position = "{0, 0},{0.501, 0}"
    script.Parent.Parent.visible = false
end)
script.textButton.MouseButton1Down:connect(function()
script.Parent,click.play()      
    script.Parent.Text = 'Hide'
    script.Parent.Position = "{0.086, 0},{0.501, 0}"
    script.Parent,Parent.visible = true
end)

Heres a script I'm trying to use for the team select itself.

game.Players.PlayerAdded:connect(function(newPlayer)
   if newPlayer:IsInGroup(3738803) then  
    Parent.visible = true
    if
[Im confused here]
end

Basically, this is me trying to make it hide if they're not in the group, but show when they are.

Note: The bottom script goes into an individual button.

0
on the second script remove the if uuoc 0 — 6y
0
Rather than if, you would do else, so its something like (If this then do this, else do this) EnderGamer358 79 — 6y

1 answer

Log in to vote
0
Answered by
FazNook 61
6 years ago
Edited 6 years ago

First of all, I'll go easy on you. In your first script, you are trying to set the position to a string value. Please change it to: script.Parent.Position = UDim2.new(0,0,0.501,0) In the 11th line of your first script, you will have to change it to script.Parent.Visible,Parent.Visible = false. There can be multiple errors in your current line such as script.Parent is not a valid member of "parent" and visible with a "v" won't be working.

To hide the GUI from all the non-group members, all you have to do is add else Parent.Visible = false after you've set Parent.Visible = true for all group members. There is no need to add another ifstatement there.

Thank you!

0
Doesn't seem to work for me. CaptainAlien132 225 — 6y
Ad

Answer this question