I am trying to make a gui of the tool, but first i just want to make a simple gui appear before moving on to anything else. I got a simple gui script, put it in playerGui and it worked perfectly, now that I have moved it to appear on equip, it doesn't work. Any thoughts?
local tool = script.Parent
local player = game.Players.LocalPlayer
tool.Equipped:connect(function(mouse)
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent.Parent
local textLabel = Instance.new("TextLabel")
textLabel.Parent = screenGui
textLabel.Position = UDim2.new(0, 25, 0, 50)
textLabel.Size = UDim2.new(0, 150, 0, 50)
textLabel.BackgroundColor3 = BrickColor.White().Color
textLabel.Text = "Hello ROBLOX!"
end)

2 comments
Ur placing the gui inside the character because when you equip it the script.Parent.Parent is the character and not the PlayerGui
at line 8 it should be screenGui.Parent = player.PlayerGui