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

How to make a GUI appear when a tool is equipped?

In the tool, there is a ScreenGui that when then the tool is equipped, I want the Gui to appear.

script.Parent.Equipped:connect(function(mouse)
    print("Portable Vending Machine was equipped")
	if mouse ~= nil then
		local GUIClone script.Parent.ScreenGui:Clone()
		GUIClone.Parent = game.Players.LocalPlayers.PlayerGui
	end
end)

When I did this, it didn't work. Any suggestions?

1 comment

1

You're missing an equal sign on line 4

1 answer

You actualy missed a couple things. Try this script:

script.Parent.Equipped:connect(function(mouse)
    print("Portable Vending Machine was equipped")
    if mouse ~= nil then
        local GUIClone=script.Parent.ScreenGui:Clone() --You forgot the equal sign here
        GUIClone.Parent = game.Players.LocalPlayer.PlayerGui --It has to be "LocalPlayer", not "LocalPlayers". Drop the 's'
    end
end)

I fixed the 2 things I think you missed. Anyways, this should work now. If not, or if you have any question, please leave a commet below. Hope I helped :P

1 comment

0

This didn't work...

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