local Humanoid = script.Parent:WaitForChild('Humanoid')
local con
local inarea = false
local player = game.Players.LocalPlayer
local Start = tick()
con = Humanoid.Died:Connect(function()
con:Disconnect()
script:Destroy()
end)
local function GetRegion(p)
return Region3.new((p.Position + (p.Size/2)),(p.Position - (p.Size/2)))
end
while (true) do
if (Humanoid.Health < 1) then
break;
end
if (inarea) then
Humanoid:UnequipTools()
if (player.Team ~= game.Teams.Civilian and player.Team ~= game.Teams.Incarcerated) then
player.PlayerGui.Game.FrameWork.leavespawn.Visible = true
if (tick() - Start) > 30 then
game.ReplicatedStorage.Events.re:FireServer({'l,e'})
end
end
end
local Parts = workspace:FindPartsInRegion3WithIgnoreList(GetRegion(workspace.Map.CopRespawn.CopRemover),{workspace.Vehicles,workspace.Map.Buildings,workspace.Map["Highways & Roads"],workspace.Map.CarSpawnCitizen},math.huge)
for i,v in ipairs(Parts) do
print(v.Name)
local ot = game.Players:GetPlayerFromCharacter(v.Parent)
if (ot) then
if (ot == player) then
inarea = true
player.PlayerGui.Game.FrameWork.safezone.Visible = true
end
elseif not (ot) and (ot ~= player) then
inarea = false
Start = tick()
player.PlayerGui.Game.FrameWork.safezone.Visible = false
player.PlayerGui.Game.FrameWork.leavespawn.Visible = false
end
end
wait(0.5)
end
Basically, want to turn on a GUY when the player is on a region, the weird think, is that is not even print a part name.