Sup, so I am doing an tool for a bus game and I want a tool which checks if player has ticket or not. I already have the tool and checking for the player's name, but when I want to update the GUI it just doesn't work. It normally prints to the output. It doesn't throw any errors. Here's my code:
script.Parent.Equipped:Connect(function(mouse)
human = script.Parent.Parent.Name
local humanP = game.Players:findFirstChild(human)
script.Parent.ScanGUI:clone().Parent = game.Players:findFirstChild(human).PlayerGui
mouse.Button1Down:Connect(function()
if mouse.Target.Parent:FindFirstChild("Humanoid") then
print(mouse.Target.Parent.Name)
local guimouse = mouse.Target.Parent.Name
local guiname = game.Players:findFirstChild(human).PlayerGui.ScanGUI.Username
guiname = guimouse
else
print("not a player")
end
end)
end)
script.Parent.Unequipped:Connect(function()
game.Players:findFirstChild(human).PlayerGui.ScanGUI:remove()
end)
and here's my workspace: https://prnt.sc/v3swy0
Thank you in advance for any help.

1 comment
Nevermind, found out I was changing the variable, not the text.