Advertisement
DanielSiqueira

AA2

Jan 25th, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. local Camera = Instance.new('Camera')
  2. local HUD = script.Parent:WaitForChild('HUD')
  3. local RunService = game:GetService('RunService')
  4. local RenderPriority = Enum.RenderPriority.Last.Value
  5. local partsToUpdate = {['Sword']=true}
  6.  
  7. local Angles = CFrame.Angles
  8. local NewCFrame = CFrame.new()
  9. local Rad = math.rad
  10.  
  11. local Viewport = HUD:WaitForChild('PlayerView')
  12.  
  13. Camera.Parent = HUD
  14. Viewport.CurrentCamera = Camera
  15.  
  16. print(Camera)
  17.  
  18. local player = game.Players.LocalPlayer
  19. local character = player.Character or player.CharacterAdded:Wait()
  20.  
  21. character.Archivable = true
  22.  
  23. character:WaitForChild('HumanoidRootPart')
  24.  
  25. wait(1)
  26.  
  27. local newchar = character:Clone()
  28. local mainPos = newchar.PrimaryPart.CFrame
  29. local RotationInc = 0
  30.  
  31. character.Archivable = false
  32.  
  33. newchar.Parent = Viewport
  34. local newhum = newchar.Humanoid
  35.  
  36. newhum.HealthDisplayDistance = 0
  37. newhum.NameDisplayDistance = 0
  38. newchar.Name = ''
  39. Camera.CFrame = (newchar:WaitForChild('HumanoidRootPart').CFrame * NewCFrame(0,0,-6.5)) * Angles(0,math.pi,0)
  40.  
  41. function updateCharacter()
  42. print('UPDATING CHARACTER')
  43. character.Archivable = true
  44. newchar:Destroy()
  45.  
  46. newchar = character:Clone()
  47. newchar:SetPrimaryPartCFrame(mainPos)
  48. local newhum = newchar.Humanoid
  49. newhum.HealthDisplayDistance = 0
  50. newhum.NameDisplayDistance = 0
  51. newchar.Name = ''
  52. newchar.Parent = Viewport
  53.  
  54. character.Archivable = false
  55.  
  56. end
  57.  
  58. character.ChildAdded:Connect(updateCharacter)
  59. character.ChildRemoved:Connect(updateCharacter)
  60.  
  61. while wait() do
  62.  
  63. if character.Humanoid.Health > 0 then
  64.  
  65. newchar.Parent = workspace
  66.  
  67. RotationInc = RotationInc < 360 and RotationInc + 1 or 0
  68. newchar:SetPrimaryPartCFrame(mainPos*Angles(0,Rad(RotationInc),0))
  69.  
  70. newchar.Parent = Viewport
  71.  
  72. end
  73.  
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement