Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local atk_remote = game.ReplicatedStorage.Remotes.Gameplay.Damage
- local shoot_remote = game.ReplicatedStorage.Remotes.GunRemotes.GunDamage
- function findgun()
- local fold = plr.PlayerStats
- local loado = fold.Loadout
- if #loado.Primary:GetChildren() > 0 then
- return loado.Primary:GetChildren()[1].Name
- else
- return loado.Secondary:GetChildren()[1].Name
- end
- end
- while true do
- wait(.01)
- if plr.Character.Mob.Value ~= "Zombie" then
- for i,v in pairs(game.Players:GetPlayers())do
- local dchar = game.Workspace:FindFirstChild(v.Name)
- if dchar ~= nil then
- if dchar:FindFirstChild("Mob") ~= nil then
- if v.Character:FindFirstChild("Mob").Value == "Survivor" then
- if v.Character.Humanoid.Health > 0 then
- char.HumanoidRootPart.CFrame = v.Character.HumanoidRootPart.CFrame
- atk_remote:FireServer(v.Character.Humanoid, "Zombie")
- end
- end
- end
- end
- end
- else
- --human script
- for i,v in pairs(game.Players:GetPlayers())do
- if Workspace:FindFirstChild(v.Name) ~= nil then
- local hchar = Workspace:FindFirstChild(v.Name)
- if hchar:FindFirstChild("Mob") ~= nil then
- if hchar:FindFirstChild("Mob").Value ~= "Survivor" then
- if hchar.Humanoid.Health > 0 then
- local wpn = findgun()
- if char:FindFirstChild(wpn) ~= nil then
- shoot_remote:FireServer(v.Character.Humanoid, wpn, v.Character.Head)
- else
- char.Humanoid:EquipTool(plr.Backpack:FindFirstChild(wpn))
- shoot_remote:FireServer(v.Character.Humanoid, wpn, v.Character.Head)
- end
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement