My code:
local TeamChecker = script.Parent
print("before touched")
TeamChecker.Touched:Connect(function(hit)
local Tycoons = game.Workspace["Zednov's Tycoon Kit"].Tycoons
print("touched works")
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit)
for _,child in pairs(Tycoons:GetChildren()) do
if child.Owner.Value == nil then
print("child found")
player.TeamColor.Value = BrickColor.new("Really red")
child.Owner.Value = player.Name
break
end
end
end
end)
Error:
I don’t know how to fix that