Advertisement
yamanohera155233

Untitled

Jun 18th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. script.Parent = nil
  2. me = game:service("Players").Yamanohera15523
  3.  
  4. num = 0
  5. local base = workspace.Base
  6.  
  7. function CloneMe(random, walk, rw, amount)
  8. local char = me.Character
  9. if char then
  10. char.archivable = true
  11. for i = 1, amount do
  12. num = num + 1
  13. local charclone = char:clone()
  14. for _,v in pairs(charclone:children()) do if v:IsA("Model") then v:remove() end end
  15. local hed = charclone.Head
  16. local neck = charclone.Torso.Neck
  17. local fake = hed:clone()
  18. fake.Parent = charclone
  19. hed.Transparency = 1
  20. local w = Instance.new("Motor6D",charclone.Torso)
  21. w.Part0 = w.Parent
  22. w.Part1 = fake
  23. w.C0 = neck.C0
  24. w.C1 = neck.C1
  25. charclone.Parent = workspace
  26. charclone:MakeJoints()
  27. charclone.Name = me.Name:sub(1,5).." Num "..num
  28. charclone:MoveTo(char.Torso.Position + Vector3.new(math.random(-random, random), math.random(-random, random), math.random(-random, random)))
  29. local hum = charclone.Humanoid
  30. local torso = charclone.Torso
  31. local pos = torso.Position
  32. hum.Died:connect(function() wait(3) charclone:remove() end)
  33. if walk then
  34. coroutine.resume(coroutine.create(function()
  35. while charclone.Parent ~= nil do
  36. wait(0.2)
  37. local rand = math.random(1,10)
  38. if rand == 1 then
  39. rand = math.random(1,4)
  40. if rand == 1 then
  41. hum.Jump = true
  42. end
  43. hum:MoveTo(pos + Vector3.new(math.random(-rw, rw), 0, math.random(-rw, rw)), base)
  44. end
  45. end
  46. end))
  47. end
  48. end
  49. end
  50. end
  51.  
  52. function FindAny(str, what, which)
  53. local where = 0
  54. local a, b = nil, nil
  55. for i=1,#str do
  56. if str:sub(i,i + #what - 1) == what then
  57. where = where + 1
  58. if where == which then
  59. a, b = i, i+ #what-1
  60. break
  61. end
  62. end
  63. end
  64. return a, b
  65. end
  66.  
  67. me.Chatted:connect(function(msg)
  68. if string.sub(msg, 1, 6):lower() == "clone:" then
  69. pcall(function()
  70. local a1, b1 = FindAny(msg, ",", 1)
  71. local amount = tonumber(msg:sub(7, b1-1))
  72. local a2, b2 = FindAny(msg, ",", 2)
  73. local walk = tonumber(msg:sub(b1+1, b2-1))
  74. local walk2 = false
  75. if walk ~= nil then if walk > 0 then walk2 = true else walk2 = false end end
  76. local a3, b3 = FindAny(msg, ",", 3)
  77. local walkarea = tonumber(msg:sub(b2+1, b3-1))
  78. local b4 = #msg
  79. local area = tonumber(msg:sub(b3+1, b4))
  80. if area then
  81. CloneMe(area, walk2, walkarea, amount)
  82. end
  83. end)
  84. elseif msg == "remove" then
  85. script.Disabled = true
  86. end
  87. end)
  88.  
  89. while true do
  90. pcall(function() base = workspace.Base end)
  91. wait()
  92. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement