My Objective here is too make it to where when this tool is Equipped the Text On The Text Label Changes. I have a feeling it has something to do with the Function. Any Help Here? Nothing in Output
Nar = game.StarterGui.Narration.TextLabel tool = script.Parent tool.Equipped:connect(function() Nar.Text = "Hm, This should work..." end)
This mistake is made a ton.
StarterGui isn't not what the player sees. It's a container that stores GUIs.
When a player respawns, everything in StarterGui is cloned into their particular PlayerGui.
That's where you need to make your changes, because that's what the player is currently viewing.
You should be using a LocalScript anyways -- the tool will be inside the Player, after all. That means we'll use game.Players.LocalPlayer
to access the Player, then access their PlayerGui from there.
local plr = game.Players.LocalPlayer local plrGui = plr:WaitForChild("PlayerGui") local tool = script.Parent tool.Equipped:connect(function() local gui = plrGui:WaitForChild("Narration"):WaitForChild("TextLabel") gui.Text = "Hm, This should work..." end)
All the WaitForChild
s are probably unnecessary, but I always like to use them in case someone is very laggy, just to try to prevent all possible errors.