teotv202

Untitled

Mar 11th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.85 KB | None | 0 0
  1. local player = owner
  2. player.Character.Archivable = true
  3. local e = player.Character:Clone()
  4. e.Name = "Citizen"
  5. e.Parent = player.Character
  6. e["Left Leg"].CFrame = workspace.Base.CFrame
  7. --[[
  8. e.HumanoidRootPart.Touched:connect(function(part)
  9. local humanoid = part.Parent:findFirstChildOfClass("Humanoid")
  10. if part then
  11. humanoid:TakeDamage(10)
  12. end
  13. end)
  14. ]]--
  15.  
  16. gc = e:GetChildren()
  17. for i=1, #gc do
  18. if gc[i].ClassName == "Part" then
  19. gc[i].Transparency = 0
  20. if gc[i]:FindFirstChildOfClass("Decal") then
  21. gc[i]:FindFirstChildOfClass("Decal")
  22. end
  23. end
  24. if gc[i].ClassName == "Accessory" then
  25. gc[i].Handle:remove()
  26. end
  27. end
  28.  
  29.  
  30. local CurrentPart = nil
  31. local MaxInc = 20
  32.  
  33. function onTouched(hit)
  34.     if hit.Parent == nil then
  35.         return
  36.     end
  37.  
  38.     local humanoid = hit.Parent:findFirstChild("Humanoid")
  39.  
  40.     if humanoid == nil then
  41.         CurrentPart = hit
  42.     end
  43. end
  44.  
  45. function waitForChild(parent, childName)
  46.     local child = parent:findFirstChild(childName)
  47.  
  48.     if child then
  49.         return child
  50.     end
  51.  
  52.     while true do
  53.         print(childName)
  54.  
  55.         child = parent.ChildAdded:wait()
  56.  
  57.         if child.Name==childName then
  58.             return child
  59.         end
  60.     end
  61. end
  62.  
  63. local Figure = e
  64. local Humanoid = waitForChild(Figure, "Humanoid")
  65. local Torso = waitForChild(Figure, "Torso")
  66. local Left = waitForChild(Figure, "Left Leg")
  67. local Right = waitForChild(Figure, "Right Leg")
  68.  
  69. Humanoid.Jump = true
  70.  
  71. Left.Touched:connect(onTouched)
  72. Right.Touched:connect(onTouched)
  73.  
  74. while true do
  75.     wait(math.random(2, 6))
  76.  
  77.     if CurrentPart ~= nil then
  78.         if math.random(1, 2) == 1 then
  79.             Humanoid.Jump = true
  80.         end
  81.  
  82.         Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart)
  83.     end
  84. end
  85. --[[
  86. while wait() do
  87. e.Humanoid.WalkSpeed = 16
  88. e.Humanoid.WalkToPoint = e["Left Arm"].Position
  89. e.Humanoid.WalkToPoint = e["Right Arm"].Position
  90. end
  91. ]]--
Add Comment
Please, Sign In to add comment