I aim to create a script that automatically unequips the item a player is holding when they enter a PvP zone, but I am currently struggling to do so, I think It is pretty easy to do
local region = game.Workspace.Arena.Give
local plr = game.Players.LocalPlayer
local char = plr.Character
while wait(1) do
local NoBackpackRegion = Region3.new(region.Position - (region.Size/2), region.Position + (region.Size/2))
local partsInRegion = game.Workspace:FindPartsInRegion3WithWhiteList (NoBackpackRegion, char:GetDescendants())
local isInRegion = false
for i, part in pairs (partsInRegion) do
if part:FindFirstAncestor(plr.Name) then
isInRegion = true
end
end
if isInRegion == true then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
if char.EquippedTool then
char.EquippedTool.Parent = game.ReplicatedStorage
end
else
game.StarterGui:SetCoreGuiEnabled (Enum.CoreGuiType.Backpack, true)
end
end