Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 comments

0

What was the reason for changing the first line if it worked just fine?

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.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.