I am trying to help my friend with a menu for his airline group and I'm making a menu for him. I have the Menu GUI done but for whatever reason, I can't seem to make the GUI appear when you equip the tool. If you can help I'll be really thankful. I'm usually good at scripting but for some reason, I just can't seem to find the solution to this.
Current Code -
local tool = script.Parent local player = game.Players.LocalPlayer local menuGui = game.ServerStorage.MenuGui tool.Equipped:connect(function() local menuGuiCopy = menuGui:Clone() menuGuiCopy.Parent = player.PlayerGui end)
(I have the finished GUI in ServerStorage)
Try this
local tool = script.Parent local player = game.Players.LocalPlayer local menuGui = tool:WaitForChild('MenuGui') tool.Equipped:Connect(function() local menuGuiCopy = menuGui:Clone() menuGuiCopy.Parent = player.PlayerGui end)
It work for me
Make sure the script you are using is a LocalScript. Also you may not have the GUI enabled. One more thing use Connect not connect :)
local tool = script.Parent local player = game.Players.LocalPlayer local menuGui = game.ServerStorage.MenuGui tool.Equipped:Connect(function() local menuGuiCopy = menuGui:Clone() menuGuiCopy.Parent = player.PlayerGui menuGuiCopy.Enabled = true end)