Alright, I analyzed your script and there's lots of problems with it that are concerning me because of what you're trying to achieve.
I will just tell you what's wrong in the script and then I'll do another script which will tell you what you need to put in there or fix.
##Here's your script:
script.Parent.Touched:connect(function()
local guard game.Players.LocalPlayer.TeamColor = BrickColor('Bright blue')
if guard then
script.Parent.CanCollide = false
script.Parent.Transparency = 1
wait(1)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
else
end
end)
##Here is the script, after I made a bit of adjustments.
script.Parent.Touched:connect(function(obj)
local hum = obj.Parent:findFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(obj.Parent)
local teamcolor = player.TeamColor
if teamcolor == BrickColor.new("Bright blue") and hum then
end
end)
----EDITED----
#Well, I hope I helped in one way or another and if you have any questions please post them in the comments below.
~~ KingLoneCat
1 comment
One of the errors is you forgot to put a = after guard and have the end not counted as comment.