Hi there! What is wrong with this simple script? Thanks in advance!
TeamColor = BrickColor.new("Bright blue") ---For this script to work, i need --the exact color of the team that may touch it only replace the stuff inside ""
script.Parent.Touched:connect(function(hit)
print(hit)
if hit.Parent.TeamColor == BrickColor.new("Bright blue") then
hit.Parent.Humanoid.Health = 0
else return
end
end)

6 comments
Thank you - but it doesn't work :(
what doesn't work?
Don't worry :) I'll work it out!
Well, actually - i'm not sure - i thought I'd solved it because it wanted a name for the function so i did function die(hit) but it still doesn't work :(
Sorry, I only posted the function itself without the connection, but forgot to mention it. I edited it to include the connection correctly now
Thanks!