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

Simple Gui Problem?

Asked by 10 years ago
function onClicked()
    script.Parent.Parent.Fight.Visible = true
end

script.Parent.MouseButton1Down:connect(onClicked)

So, I want the above script to make a frame visible, it is in a local script, but, It does nothing when I press the button...

EDIT: Should probably add in this detail: The script works fine in studio, buts when playing the game on roblox it self, doesn't work.

0
Any errors? GoldenPhysics 474 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
script.Parent.MouseButton1Click:connect(function()
print("Clicked")
    script.Parent.Parent:WaitForChild("Fight")
print("Found Fight")
    script.Parent.Parent.Fight.Visible = true
print("Visible")
end)



Ok, so I edited it a bit. I added a WaitForChild just in case it isnt loading or anything.

I also added prints. If you go into the game and press F9, it shows a little output and can tell you any errors. Comment back on what prints/doesnt print.

0
So, I loaded the console, again, the frame doesn't become visible, but, I do get all the output in the console. notRezznov 35 — 10y
0
What is Fight? is it a frame, or what. Tempestatem 884 — 10y
0
A frame. notRezznov 35 — 10y
Ad

Answer this question