Answered by
7 years ago Edited 7 years ago
I know what's going on.
A thing I learned recently: When there's a .Touched event, the LocalScript / Script NEEDS to be putted in the StarterGui. Other thing, I don't really like using NumberValues, I would recommend you using IntValues. Having said that, here's what you want:
01 | local TeamA = Instance.new( "IntValue" ) |
04 | TeamA.Parent = game.Workspace |
06 | local TeamB = Instance.new( "IntValue" ) |
09 | TeamB.Parent = game.Workspace |
11 | script.Parent.Touched:connect( function (hit) |
15 | local Character = hit.Parent.Name |
16 | local Player = game.Players [ Character ] |
18 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
19 | script.Parent.BrickColor = Player.TeamColor |
23 | if Player.Team = = game.Teams.TeamA then |
24 | game.Workspace.TeamA = game.Workspace.TeamA.Value + 1 |
25 | Player.leaderboard.Painted.Value = Player.leaderboard.Painted.Value + 1 |
27 | elseif Player.Team = = game.Teams.TeamB then |
28 | game.Workspace.TeamB = game.Workspace.TeamB.Value + 1 |
29 | Player.leaderboard.Painted.Value = Player.leaderboard.Painted.Value + 1 |
After 2 hours, here's your script there up ^^
If this solves your problem, please mark as the solution.
As always, good scripting!