Advertisement
Nadds

For iBookshelf

May 28th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. if player.Stage.Value == "Combat3" then
  2. local function TransformModel(objects, center, new, recurse)
  3. for _,object in pairs(objects) do
  4. if object:IsA("BasePart") then
  5. object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame))
  6. end
  7. if recurse then
  8. TransformModel(object:GetChildren(), center, new, true)
  9. end
  10. end
  11. end
  12.  
  13. local bot = game.Lighting.Combat3SwordBot:clone()
  14. bot.Parent = camera
  15.  
  16. local sword = game.Lighting.CombatWeps.Combat3.LinkedSword:clone()
  17. sword.Parent = player.Backpack
  18.  
  19. bot.Weapon.Hitter.Touched:connect(function(hit)
  20. if hit:IsDescendantOf(char) then
  21. char.Humanoid:TakeDamage(30)
  22. end
  23. end)
  24.  
  25. Spawn(function()
  26. while wait() do
  27. Spawn(function()
  28. wait(1)
  29. TransformModel(
  30. bot:GetChildren(),
  31. bot.Body.Main.CFrame,
  32. CFrame.new(
  33. bot.Body.Main.Position,
  34. Vector3.new(
  35. char.Torso.Position.x,
  36. bot.Body.Main.Position.y,
  37. char.Torso.Position.z
  38. )
  39. --char.Torso.Position + ( --* Vector3.new(1, 0, 1)
  40. ) * CFrame.Angles(0, math.rad(180), 0),
  41. true
  42. )
  43.  
  44. --[[TransformModel(
  45. bot.Weapon:GetChildren(),
  46. bot.Weapon.Main.CFrame,
  47. CFrame.new(
  48. bot.Weapon.Main.Position,
  49. Vector3.new(
  50. bot.Body.Main.Position.x,
  51. char.Torso.Position.y,
  52. bot.Body.Main.Position.z
  53. )
  54. ) * CFrame.Angles(0, math.rad(-90), 0),
  55. true
  56. )]]
  57. end)
  58. end
  59. end)
  60.  
  61. Spawn(function()
  62. repeat wait() until bot.Health.Value <= 0
  63. bot:Destroy()
  64. player.StagesCompleted[player.Stage.Value].Value = true
  65. player.Stage.Value = ""
  66. --LoadCharacter(player)
  67. DeleteBodyParts()
  68. end)
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement