It has no output, but yet it won't insert the BillboardGui into the character's head.
Players=Game:service("Players")
local img=script.Picture:Clone()
Allowed={"TheNewScripter","Player"};
function Check(name)
for _,allow in pairs(Allowed) do
if name:lower()==allow:lower() then
return true
end
end
return false
end
function onPlayerRespawn(prop,play)
if prop=="Character" and play.Character then
local head;
repeat wait() until play.Character:findFirstChild("Head")
head=play.Character.Head
local bg=Instance.new("BillboardGui",head)
bg.Adornee=head
bg.Name="Display"
bg.StudsOffset=Vector3.new(0,2,0)
local picture=img:Clone()
picture.Parent=bg
end
end
function onPlayerEntered(new)
local checkIfAllowed=Check(new.Name)
if checkIfAllowed then
new.Changed:connect(function(property) onPlayerRespawn(prop,new) end)
end
end
Players.PlayerAdded:connect(onPlayerEntered) |