Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local char = plr.Character
  3. local atk_remote = game.ReplicatedStorage.Remotes.Gameplay.Damage
  4. local shoot_remote = game.ReplicatedStorage.Remotes.GunRemotes.GunDamage
  5.  
  6. function findgun()
  7. local fold = plr.PlayerStats
  8. local loado = fold.Loadout
  9.  
  10. if #loado.Primary:GetChildren() > 0 then
  11. return loado.Primary:GetChildren()[1].Name
  12. else
  13. return loado.Secondary:GetChildren()[1].Name
  14. end
  15. end
  16.  
  17. while true do
  18. wait(.01)
  19. if plr.Character.Mob.Value ~= "Zombie" then
  20. for i,v in pairs(game.Players:GetPlayers())do
  21. local dchar = game.Workspace:FindFirstChild(v.Name)
  22. if dchar ~= nil then
  23. if dchar:FindFirstChild("Mob") ~= nil then
  24. if v.Character:FindFirstChild("Mob").Value == "Survivor" then
  25. if v.Character.Humanoid.Health > 0 then
  26. char.HumanoidRootPart.CFrame = v.Character.HumanoidRootPart.CFrame
  27. atk_remote:FireServer(v.Character.Humanoid, "Zombie")
  28. end
  29. end
  30. end
  31. end
  32. end
  33.  
  34.  
  35. else
  36. --human script
  37.  
  38. for i,v in pairs(game.Players:GetPlayers())do
  39. if Workspace:FindFirstChild(v.Name) ~= nil then
  40. local hchar = Workspace:FindFirstChild(v.Name)
  41. if hchar:FindFirstChild("Mob") ~= nil then
  42. if hchar:FindFirstChild("Mob").Value ~= "Survivor" then
  43. if hchar.Humanoid.Health > 0 then
  44. local wpn = findgun()
  45. if char:FindFirstChild(wpn) ~= nil then
  46. shoot_remote:FireServer(v.Character.Humanoid, wpn, v.Character.Head)
  47. else
  48. char.Humanoid:EquipTool(plr.Backpack:FindFirstChild(wpn))
  49. shoot_remote:FireServer(v.Character.Humanoid, wpn, v.Character.Head)
  50. end
  51. end
  52. end
  53. end
  54. end
  55. end
  56.  
  57. end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement