Hi, I made kill players and steal time game and I really need help with the safe zone when players are trying to escape from being killed they land in the safe zone
If anyone knows a script or they can help me that would be awesome
4
I don’t know how to script or make the safe zone
game.Workspace.Safezone.Touched:Connect(function(player)
if game.Players: FindFirstChild (player.Parent.Name) then
local forcefield = Instance.New("ForceField", player)
end
end)
game.Workspace.Safezone.TouchEnded:Connect(function(player)
if game.Players: FindFirstChild (player.Parent.Name) then
player: WaitForChild("ForceField"):Destroy()
end
end)
Your script will not work considering damage is dealt on the server.
A script could be used that does the exact same thing, but using the player’s character provided in the .Touched event.
Example:
safeZoneExitParts would be folder containing parts next to the bounds of the safezone. (parts that you would have to touch to leave the safezone.)
local safeZone = game.Workspace.safeZone
local safeZoneExitParts = gane.Workspace.safeZoneExits:GetChildren()
safeZone.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") and not part.Parent:FindFirstChild("szFF") then
local ff = Instance.new("ForceField", part.Parent)
ff.Name = "szFF"
end)
for i,v in pairs(safeZoneExitParts) do
v.Touched:Connect(function(part)
if part.Parent:FindFirstChild("szFF") then
part.Parent.szFF:Destroy()
end
end)
end
You would put it into ServerScriptService.
Before you can use it, you would need to make a part called safeZone and make sure the part is in a place where it will be touched upon entering or whilst being in the safezone.
After that, you will need to make a folder called safeZoneExits. Inside that folder, you will need to put parts around the safezone that will be touched as someone exits the safezone.