I have a billboardGUI that I’m using as a nametag system, but the problem is the onchatted event I have is not working. When the player chats a commands, a image should show, but it does not work.
Script:
local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent.Parent)
local char = script.Parent.Parent.Parent
local sshow = false
script.Parent.TextFrame.User.Text = script.Parent.Parent.Parent.Name
script.Parent.TextFrame.User.Back.Text = script.Parent.Parent.Parent.Name
local humanoid = script.Parent.Parent.Parent:FindFirstChild("Humanoid")
game.Players.PlayerAdded:Connect(function(player)
local gr = player:GetRankInGroup(7067077)
player.Chatted:connect(function(msg)
if gr > 13 then
msg=msg:lower()
if (msg == "!sshow") and sshow == false then
sshow = true
char.Head.Tag.Icons.DDZ_76.Visible = true
print("TagShown")
end
if (msg == "!shide") and sshow == true then
sshow = false
char.Head.Tag.Icons.DDZ_76.Visible = false
print("TagHidden")
end
end
end)
end)
Model (Put in ServerScriptService):
42Nametag.rbxm (11.9 KB)