Script:
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
wait()
local d = chr:FindFirstChild("Hat")
for i,v in pairs(d) do
v:Destroy()
end
end)
end)
Script:
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
wait()
local d = chr:FindFirstChild("Hat")
for i,v in pairs(d) do
v:Destroy()
end
end)
end)
It isn't working because it is looking for a child inside the players character that is called "hat". Try this instead:
while wait() do
for i,v in pairs(game.Players:GetPlayers()) do
if workspace:FindFirstChild(v.Name) then
local char = workspace:WaitForChild(v.Name)
for i,v in pairs(char:GetChildren()) do
if v.ClassName == "Hat" then
v:Destroy()
end
end
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Doesn't work. :(
Okay I have changed the code, now see if it works.
Now it works. Thanks a lot.
No problem.