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

Can you disable a script / localscript inside a Region3?

Asked by 8 years ago

Is it possible to have disabled or enabled state in a specific region3 so it's unable to be used in that specific region?

1 answer

Log in to vote
0
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

I think using FindPartsInRegion3 and disabling would work. Note: I don't have much experience with Region3, so there's probably a much more efficient way to do this.

while wait() do
    for _, v in pairs (game.Workspace:FindPartsInRegion3(NameOfRegion, nil, 100)) do
        if v.Name == player.Name then
            NameOfScript.Disabled = true
            break
        end
        NameOfScript.Disabled = false
    end
end
Ad

Answer this question