trying to make a gui aka a (it) gui for the tag to appear over someones head when they first join aka who ever joins game first is it but im having a Torso is not a valid member of DataModel error and can't figure out why.
local rs = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Tagger = false
local Gui = rs:WaitForChild("Gui")
Players.PlayerAdded:Connect(function(plr)
if Tagger == false then
Tagger = true
repeat
wait()
until plr.Character
Gui.Parent = plr.Character
Gui.Adornee = plr.Character.Head
end
end)
local Players = game:GetService("Players")
local Gui = script.Parent
local GuiOwner = Gui.Parent
local Torso = GuiOwner.Torso
wait(.5)
Torso.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if Players:FindFirstChild(hit.Parent.Name) then
local NewGui = Gui:Clone()
NewGui.Parent = hit.Parent
NewGui.Adornee = hit.Parent.Head
Gui:Destroy()
end
end
end)

1 comment
I'm pertty sure that you need to replace torso with HumanoidRootPart if you are using r15