So, I'm trying to have a Gui display what item the character is holding (Its image, name and tooltip). Here's my script in its entirety:
local player = game.Players.LocalPlayer
local character = player.Character
if not character then
character = player.CharacterAdded:wait()
end
character = player.Character
local frame = script.Parent.Frame
local image = frame.ItemImage
local name = frame.ItemName
local tooltip = frame.ItemToolTip
character.Changed:connect(function()
if character:FindFirstChildOfClass("Tool") then
name.Text = character:FindFirstChildOfClass("Tool").Name
tooltip.Text = character:FindFirstChildOfClass("Tool").ToolTip
image.Image = character:FindFirstChildOfClass("Tool").TextureId
end
end)
When I run it and pull out a tool, nothing changes. I don't get any errors... Anyone know what I'm doing wrong?
P.S. This is in a LocalScript within the StarterGui.
