Mryeetmemes

Drooling Zombie Script

Apr 11th, 2024
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. local zombie = script.Parent
  2.  
  3. for _, script in pairs(zombie.ModuleScripts:GetChildren()) do
  4.     if not game.ServerStorage:FindFirstChild(script.Name) then
  5.         script:Clone().Parent = game.ServerStorage
  6.     end
  7. end
  8.  
  9. local AI = require(game.ServerStorage.ROBLOX_ZombieAI).new(zombie)
  10. local DestroyService = require(game.ServerStorage.ROBLOX_DestroyService)
  11.  
  12.  
  13. local function clearParts(parent)
  14.     for _, part in pairs(parent:GetChildren()) do
  15.         clearParts(part)
  16.     end
  17.     local delay
  18.     if parent:IsA("Part") then
  19.         delay = math.random(5,10)
  20.     else
  21.         delay = 11
  22.     end
  23.     DestroyService:AddItem(parent, delay)
  24. end
  25.  
  26. zombie.Humanoid.Died:connect(function()
  27.     AI.Stop()
  28.     math.randomseed(tick())
  29.     clearParts(zombie)
  30.     script.Disabled = true
  31. end)
  32.  
  33. local lastMoan = os.time()
  34. math.randomseed(os.time())
  35. while true do
  36.     local animationTrack = zombie.Humanoid:LoadAnimation(zombie.Animations.Arms)
  37.     animationTrack:Play()
  38. --  local now = os.time()
  39. --  if now - lastMoan > 5 then 
  40. --      if math.random() > .3 then
  41. --          zombie.Moan:Play()
  42. ----            print("playing moan")
  43. --          lastMoan = now
  44. --      end
  45. --  end
  46.     wait(2)
  47. end
  48.  
  49.  
Add Comment
Please, Sign In to add comment