Is my Script impacting other players?
Hello again
I'm doing a block as if it were a training area doubles my stats after entering, although I'm using Region3, when I enter my stats multiply, but those of other players multiply as well. How do I fix this?
The Script:
01 | local Players = game:GetService( "Players" ) |
02 | local Region = Region 3. new(script.Parent.Position - (script.Parent.Size / 2 ), script.Parent.Position + (script.Parent.Size / 2 )) |
04 | local function scanForPlayerInRegion(Player) |
06 | local Parts = workspace:FindPartsInRegion 3 WithWhiteList(Region, Player.Character:GetDescendants()) |
22 | for _,Plr in next ,Players:GetPlayers() do |
23 | if ( not (Plr.Character)) or ( not (Plr)) then continue end |
24 | if (scanForPlayerInRegion(Plr)) then |
26 | print ( "Player was on the part!" ) |
29 | game.ReplicatedStorage.Training = 1000000 |
33 | print ( "Player was out the part!" ) |
35 | game.ReplicatedStorage.Training = 1000 |