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

Gui is working inside of studio but it isn't work when i play the actual game?

Asked by 7 years ago
Edited 7 years ago

I apologize if there's a rule about posting too much, this is only my second post but yeah. So i recently learned how to make a Gui and i made a simple one for now just so i know for the future the basics of making one. And i tested it in Roblox Studio test and it work's flawlessly. But then i tried it in game and it didn't work? Maybe someone knows why? Not sure if it's my script. But here's my script. Super weird that it's not working.

~~~~~~~~~~~~~~~~~

local button = script.Parent local frame = script.Parent.Parent.Frame

button.MouseButton1Click:connect(function() if button.Text == "BackPack" then frame.Visible = true button.Text = "Close" elseif button.Text == "Close" then frame.Visible = false button.Text = "BackPack" end end)

~~~~~~~~~~~~~~~~~

Hopefully someone can help me figure out my problem. Not sure why the script isn't showing up on here i tried it like 5 different ways. Anyways heres a picture of the script http://imgur.com/6r9l2du

0
Try "MouseButton1Down" Mayk728 855 — 7y
0
Add a "wait()" in the beginning, maybe you're not giving the script enough time to load. strongrussianboy123 68 — 7y
0
Adding a wait worked thank you! Sniper2458 11 — 7y

1 answer

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
7 years ago

Try this:

local Button = script.Parent
local Frame = script.Parent.Parent.Frame

Button.MouseButton1Click:Connect(function()
    if Button.Text == "BackPack" then
        Frame.Visible = true
        Button.Text = "Close"
    else
        Frame.Visible = false
        Button.Text = "BackPack"
    end
end)
0
Still doesn't work. I tried publishing it to a new place rather than my old place in hopes that the old place was glitched but nope. Script still won't work. Sniper2458 11 — 7y
Ad

Answer this question