Greetings, developers. I have done this pvp and safe zone. This script just checks If a player touched part and if so It activates pvp but this does not work very well. It sometimes works and sometimes does not. Here is a video:Imgur: The magic of the Internet
Sorry for the low quality, I recorded it in the studio
The Script
local PM = game.Workspace.Arena.Give
local SZ = game.Workspace.Arena.remover.Remover
local UN = game.Workspace.Arena.Untouch
game.Players.PlayerAdded:Connect(function(plr)
local PVP = Instance.new("BoolValue")
PVP.Name = "Isworking"
PVP.Value = false
PVP.Parent = plr
end)
UN.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr.Isworking.Value == true then
wait(1)
plr.Isworking.Value = false
end
end
end)
SZ.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr.Isworking.Value == true then
wait(1)
plr.Isworking.Value = false
end
end
end)
PM.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr.Isworking.Value == false then
wait(1)
plr.Isworking.Value = true
end
end
end)