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 3 years ago
Edited 3 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

Picture = game.Workspace.Makeabook.Picture

Heres the script for the tool

local Picture = game.Workspace.Makeabook.Picture:Clone()

function onEquippedLocal(mouse)
    Player = game.Players.LocalPlayer
    Picture.Parent = Player.PlayerGui
end

function onUnS()
    selected = false
    Picture.Parent = script.Parent
end

script.Parent.Equipped:Connect(onEquippedLocal)
script.Parent.Unequipped:Connect(onUnS)

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

local Base = script.Parent.Parent.Parent
local Button = script.Parent
local MyPage = Button.Parent
local ShowPage1 = MyPage.Parent:findFirstChild("Page1")
local ShowPage2 = MyPage.Parent:findFirstChild("Page2")

function temp()
    MyPage.Visible = false
    ShowPage1.Visible = true
    ShowPage2.Visible = true
end

Button.MouseButton1Click:connect(temp)
0
What was the reason for changing the first line if it worked just fine? SilentsReplacement 468 — 3y
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 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question