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

I have a tool where if you have it equipped a gui shows, but the gui buttons dont work?

Asked by 5 years ago
Edited 5 years ago

So before I changed the first line of the first script the gui buttons worked, but the gui itself wouldn't show up in a clone of the tool, only the first one. Now the gui shows everytime, but the buttons don't work. This was the first line before I changed it

1Picture = game.Workspace.Makeabook.Picture

Heres the script for the tool

01local Picture = game.Workspace.Makeabook.Picture:Clone()
02 
03function onEquippedLocal(mouse)
04    Player = game.Players.LocalPlayer
05    Picture.Parent = Player.PlayerGui
06end
07 
08function onUnS()
09    selected = false
10    Picture.Parent = script.Parent
11end
12 
13script.Parent.Equipped:Connect(onEquippedLocal)
14script.Parent.Unequipped:Connect(onUnS)

and here's the code for one of the gui buttons

01local Base = script.Parent.Parent.Parent
02local Button = script.Parent
03local MyPage = Button.Parent
04local ShowPage1 = MyPage.Parent:findFirstChild("Page1")
05local ShowPage2 = MyPage.Parent:findFirstChild("Page2")
06 
07function temp()
08    MyPage.Visible = false
09    ShowPage1.Visible = true
10    ShowPage2.Visible = true
11end
12 
13Button.MouseButton1Click:connect(temp)
0
What was the reason for changing the first line if it worked just fine? SilentsReplacement 468 — 5y
0
It didnt work fine, before I changed it the gui didnt always show up. But after I changed it it always does, but then the gui buttons didnt work. maddiesswrld 30 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

I figured it out. I just needed to change the scripts in the guis to local scripts

Ad

Answer this question