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:
local Players = game:GetService("Players") local Region = Region3.new(script.Parent.Position - (script.Parent.Size / 2), script.Parent.Position + (script.Parent.Size / 2)) local function scanForPlayerInRegion(Player) local Parts = workspace:FindPartsInRegion3WithWhiteList(Region, Player.Character:GetDescendants()) if(#Parts >= 1)then return true else return false end end spawn(function() while(wait(1/60))do for _,Plr in next,Players:GetPlayers()do if(not(Plr.Character))or(not(Plr))then continue end --------- The line checks when player is on the part if(scanForPlayerInRegion(Plr))then print("Player was on the part!")---------------- game.ReplicatedStorage.Training = 1000000 ---- The Training is IntValue else print("Player was out the part!")-------------- The line detects the player out the part. game.ReplicatedStorage.Training = 1000 end end end end)
try using a local script. I think the problem is if you are using a normal script. a local script only works for one person.