Here...Try the script
game.Workspace.ChildAdded:connect(function(obj) -
if (obj:IsA("Hat")) then
wait(4)
if (obj.Parent == game.Workspace) then
obj:Destroy()
end
end
end)
That will remove hats
for your body color try this but remember to put it in your spawn location brick
function onTouch(hit)
local humanoid = hit.Parent.Humanoid
if humanoid ~= nil then
local head = hit.Parent.Head
local torso = hit.Parent.Torso
local leftleg = hit.Parent:findFirstChild("Left Leg")
local rightleg = hit.Parent:findFirstChild("Right Leg")
local rightarm = hit.Parent:findFirstChild("Right Arm")
local leftarm = hit.Parent:findFirstChild("Left Arm")
if head ~= nil then
head.BrickColor = BrickColor.new("Bright yellow")
if torso ~= nil then
torso.BrickColor = BrickColor.new("Bright blue")
if leftleg ~= nil then
leftleg.BrickColor = BrickColor.new("Dark green")
if rightarm ~= nil then
rightarm.BrickColor = BrickColor.new("Bright yellow")
if leftarm ~= nil then
leftarm.BrickColor = BrickColor.new("Bright yellow")
if rightleg ~= nil then
rightleg.BrickColor = BrickColor.new("Dark green")
end end end end end end
end
end
script.Parent.Touched:connect(onTouch)
you can also put this in your spawn location block as a script to remove hats
function onTouched(hit)
local d = hit.Parent:GetChildren()
for i=1, #d do
if (d[i].className == "Hat") then
d[i]:remove()
end
end
end
script.Parent.Touched:connect(onTouched)