How could I make a part when touched, gives points to the opposite team?
Asked by
5 years ago Edited 5 years ago
I am trying to make a part that when touched, adds to the value of the opposing team's points. I have already tried making a script on this, but it didn't seem to work when I test played the game. Can someone please help fix my script or make a new script? I would be very grateful. The script is the following:
01 | local p = script.Parent |
02 | local vr = game.StarterGui.ScreenGui.Frame.AwayPlayer.AwayPlayerScore.RedValue.Value |
03 | local vb = game.StarterGui.ScreenGui.Frame.HomePlayer.HomePlayerScore.BlueValue.Value |
04 | p.Touched:Connect( function (hit) |
05 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
06 | if hit.Parent.TeamColor 3 = "Bright blue" then |
08 | elseif hit.Parent.TeamColor 3 = "Bright red" then |
Thank you for trying to help. I really appreciate it.