How can I make a script only work for a specified team ?
Asked by
2 years ago Edited 2 years ago
I want to make my code only work for one team so none of the players that are not in the specified team can use this script
The code:
01 | function onPlayerEntered(newPlayer) |
03 | local stats = Instance.new( "IntValue" ) |
04 | stats.Name = "leaderstats" |
06 | local cash = Instance.new( "IntValue" ) |
11 | stats.Parent = newPlayer |
15 | cash.Value = cash.Value + 5 |
24 | game.Players.ChildAdded:connect(onPlayerEntered) |
The script is a regular script not a local script the script adds 5 "Kaproue" or money to the player every minute, I want to make it add the money to only players in a specified team