Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is my Script impacting other players?

Asked by
Games_DBZ -15
3 years ago

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)

1 answer

Log in to vote
0
Answered by
xxaxxaz 42
3 years ago

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.

0
Okay, but how can I do this in practice? Games_DBZ -15 — 3y
0
just think before you insert a script. do you want it to only apear for one person. xxaxxaz 42 — 3y
Ad

Answer this question