I’m trying to make a system where a Scroll tool has its own GUI that appears when you equip it, however, I am having trouble. It’s not erroring, it’s just not triggering the function.
-- This script displays and updates the ScrollGui.
-- setting variables
local player = game.Players.LocalPlayer
local ScrollGui = player.PlayerGui.ScrollGui
local ScrollFrame = ScrollGui.ScrollFrame
local ScrollContent = ScrollFrame.ScrollContent
local ScrollName = ScrollFrame.ScrollName
local tool = script.Parent
tool.Equipped:Connect(function()
print("hi")
-- get the attributes
local ScrollNameText = tool:GetAttribute("ScrollName")
local ScrollContentText = tool:GetAttribute("ScrollContent")
-- enable the gui
ScrollGui.Enabled = true
-- sets the text
ScrollContent.Text = ScrollContentText
ScrollName.Text = ScrollNameText
end)
tool.Unequipped:Connect(function()
-- disables the gui
ScrollGui.Enabled = false
end)
Hierarchy:


More info:
The tool is added to the player’s backpack when the player interacts with a ProximityPrompt, and that part is working, I’ve checked.
Thanks!