You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Im trying to make a safezone so players in the safezone cannot deal with damage by others with swords. -
What is the issue? Include screenshots / videos if possible!
Issue is i keep getting errors and i cant figure out how to fix them. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Tried looking on fourm, yt. Everything seems to not be what im looking for.
I am using Zone+. I think thats what it called, forgot.
local ServerScriptService = game:GetService'ServerScriptService'
local Http = game:GetService'HttpService'
local Zone = require(game:GetService("ReplicatedStorage").Zone)
local SafeZone = workspace.SafeZone
local NewContainer = Zone.new(SafeZone)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Humanoid = character:WaitForChild'Humanoid'
local HumanoidRootPart = character:WaitForChild'HumanoidRootPart'
local ff = Instance.new('ForceField', character)
ff.Name = 'Protection'
ff.Visible = false
local findSafe = player:WaitForChild('isSafe', 5)
player.isSafe.Value = true
end)
NewContainer.playerEntered:Connect(function(player)
local character = player.Character
if player ~= nil then
if player.isSafe.Value == false then
player.isSafe.Value = true
local ff = Instance.new('ForceField', character)
ff.Name = 'Protection'
ff.Visible = false
end
end
end)
NewContainer.playerExited:Connect(function(player)
local character = player.Character
if player ~= nil then
if player.isSafe.Value == true then
player.isSafe.Value = false
if character:FindFirstChild'Protection' then
character.Protection:Destroy()
end
end
end
end)
end)