Hello, I have the following script.
function giveWeapon(part)
if part:GetChildren("Humanoid") then
if part.TeamColor == "Really blue" then
local BlueLaserGun = game.Workspace.BlueLaserGun:Clone()
BlueLaserGun.Parent = game.StarterPack
end
if part.TeamColor == "Really red" then
local RedLaserGun = game.Workspace.RedLaserGun:Clone()
RedLaserGun.Parent = game.StarterPack
end
end
end
script.Parent.Touched:connect(giveWeapon)
Now, this is inserted in a part and whenever I touch it, even though there are established teams, I get the error saying that TeamColor isn't a valid member of part. The Blue and Red LaserGuns do exist in Workspace. Can someone tell me why this isn't working? I would really appreciate it.

1 comment
It's cause inside that part their is no 'TeamColor' hold on a sec