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

GUI appearing help?

Asked by 10 years ago

script.Parent.MouseButton1Click:connect(function(onClicked) script.Parent.BackgroundColor3 = Color3.new(254/255, 0/255, 4/255) wait (2) script.Parent.BackgroundColor3 = Color3.new(67/255, 207/255, 42/255) end)

script.Parent.MouseButton1Click:connect(function() game.StarterGui.ScreenGui.Help.Visible = true end)

This is all in one script. When a player clicks the textbutton on the gui, another frame should become visible and the button should change colors to signify a click. The color change works, but not the visibility. I think the problem lies in this line "game.StarterGui.ScreenGui.Help.Visible = true" I don't know how to use the parent and child properly though so that is why I request help. Thanks in advance!

1 answer

Log in to vote
0
Answered by 10 years ago

You should be changing the players PlayerGuinot their StarterGui

StarterGui is the Gui Players see when they respawn, used for making class loadouts on games like Call of Robloxia PlayerGui is what the Gui that players see currently, used for making things that change a Gui, such as when you click a button a new Gui pops up, or you touch a brick and a Gui pops up. These examples aint spot on, but it may be helpful.

script.Parent.MouseButton1Click:connect(function(onClicked)
script.Parent.BackgroundColor3 = Color3.new(254/255,0/255,4/255)
wait(2)
script.Parent.BackgroundColor3 = Color3.new(67/255,207/255,42/255)

script.Parent.Parent.Parent.ScreenGui.Help.Visible = true-- Assuming this is in a script inside of the Gui's Button
end)

Any questions or concerns? Is it not working? Just leave a comment, I will answer hopefully as soon as I can.

Note: Please use Code Blocks to make your code readable

Edit: Hopefully fixed it, I messed up on some .Parent and the location of the .Help

0
It still isn't working. I checked the parent and childs, and they all lead to where they should. What is wrong with this? wantedfunnybunny2 20 — 10y
0
To clarify: StarterGui is just a container that you put your GUI objects in. When a player spawns, the items in StarterGui are copied and pasted into a PlayerGui container that is inside the Player object. Merely 2122 — 10y
0
And yeah, Merely gave a good example of the two Gui's. Also wanted I will look more into it ggggyourface23 63 — 10y
0
@Wanted I edited it, I messed up on the .Parent's I believe. Also the script I used is all assuming this script is inside of a textButton inside of a Gui ggggyourface23 63 — 10y
View all comments (4 more)
0
It still didn't work for me. The tree is: Script, Textbutton, frame, Screengui. There are two frames in the same screengui, one to summon the help with, the other to be summoned. wantedfunnybunny2 20 — 10y
0
Can you take a picture of it and show me? That would make this easier to understand. I know the script is right, just the .Parent's and locations on the script is off ggggyourface23 63 — 10y
0
Thanks dude, I just had to add an extra parent. wantedfunnybunny2 20 — 10y
0
There you go, no problem. ggggyourface23 63 — 10y
Ad

Answer this question