How can I make a safezone for my game (disabling the tools)

Where do you recommend me to store the local script for enabling and disabling the safezone?
StarterPlayerScripts or StarterPack?

I dont think a AI can help with making a script right now, since I also tried chatGTP, but the script didint really worked out that good

This script will store the player’s tools in the Tools folder when they enter the safezone, and it will give the exact same tools back to the player when they leave the safezone.

You can adjust the name of the tools folder and the safezone part as needed to suit your needs.

I hope this helps! Let me know if you have any questions or need further assistance.

local safezone = script.Parent
local toolsFolder = script:WaitForChild("Tools")

function onTouched(otherPart)
  if otherPart:IsA("Player") then
    local character = otherPart.Parent
    character.CharacterAdded:Connect(function()
      local tools = character.Backpack:GetChildren()
      for _, tool in ipairs(tools) do
        tool.Parent = toolsFolder
      end
    end)
    character.CharacterRemoving:Connect(function()
      local tools = toolsFolder:GetChildren()
      for _, tool in ipairs(tools) do
        local newTool = tool:Clone()
        newTool.Parent = character.Backpack
      end
    end)
  end
end

safezone.Touched:Connect(onTouched)
1 Like

When player removes, the tools doesn’t spawn into the backpack’s player, it does on the baseplate