So, I'm making a tycoon (with this furnace of course), but when I tested it, I joined the green team, then make a mine go into the furnace. The problem is I won't get the money from it. Any help?
script.Parent.Touched:connect(function(hit) if hit.Name == "Ore" then for i,v in pairs(game.Players:GetChildren())do if v.TeamColor == "Lime green" then v.leaderstats.Money.Value = v.leaderstats.Money.Value + hit.OreValue.Value hit:Destroy() end end end end)
Player.TeamColor
is a BrickColor
value, so you need to compare it with another BrickColor
value, not a string as you are doing.
Changing it to
if v.TeamColor == BrickColor.new("Lime green") then
...should fix your problems, assuming something else isn't wrong.