Advertisement
karobloxYT

test

Nov 26th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. wait(0.1)
  2. script:Destroy()
  3.  
  4. math.randomseed(tick())
  5.  
  6. local Player = game.Players.LocalPlayer
  7. local Character = (Player.Character or Player.CharacterAdded:wait())
  8.  
  9. Character.Archivable = true
  10.  
  11. local CharacterClone = Character:Clone()
  12. CharacterClone.Name = "0x420"
  13.  
  14. Player.Parent = nil
  15.  
  16. local Camera = workspace.CurrentCamera
  17.  
  18. local CurrentCharacter
  19. local SetupCharacter
  20.  
  21. local function Reset()
  22. CharacterClone:Destroy()
  23. wait(2.5)
  24. CurrentCharacter = SetupCharacter()
  25. end
  26.  
  27. function SetupCharacter()
  28. local Humanoid = CharacterClone:Clone():WaitForChild("Humanoid")
  29. Humanoid.Name = "Human"
  30. Humanoid.MaxHealth = math.huge
  31. Humanoid.Health = math.huge
  32. Humanoid:WaitForChild("Animator"):Destroy()
  33. local Head = CharacterClone:WaitForChild("Head")
  34. Head:WaitForChild("face").Name = "Face"
  35. Head:WaitForChild("Mesh").Name = "HeadMesh"
  36. for Index, Object in next, Head:GetChildren() do
  37. if Object:IsA("Sound") then
  38. Object:Destroy()
  39. end
  40. end
  41. CharacterClone:WaitForChild("Torso").roblox:Destroy()
  42. CharacterClone:WaitForChild("Animate"):Destroy()
  43. CharacterClone:WaitForChild("Health"):Destroy()
  44. CharacterClone:WaitForChild("Sound"):Destroy()
  45. CharacterClone:WaitForChild("Body Colors"):Destroy()
  46. for Index, Object in next, CharacterClone:GetChildren() do
  47. if Object:IsA("BasePart") then
  48. Object.BrickColor = BrickColor.new("Pastel brown")
  49. Object.Material = Enum.Material.SmoothPlastic
  50. Object.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  51. Object.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  52. Object.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  53. Object.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  54. Object.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  55. Object.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  56. end
  57. end
  58. CharacterClone.Parent = workspace
  59. CharacterClone:MakeJoints()
  60. Camera.CameraType = Enum.CameraType.Follow
  61. Camera.CameraSubject = CharacterClone
  62. Humanoid.Died:connect(Reset)
  63. workspace.ChildAdded:connect(function(Child)
  64. if (Child.Name == "0x420") then
  65. Reset()
  66. end
  67. end)
  68. return CharacterClone
  69. end
  70.  
  71. local UserInputService = game:GetService("UserInputService")
  72. local Keys = {}
  73.  
  74. UserInputService.InputBegan:connect(function(InputObject, GameProcessedEvent)
  75. if (not GameProcessedEvent) then
  76. if (InputObject.UserInputType == Enum.UserInputType.Keyboard) then
  77. Keys[InputObject.KeyCode.Name] = true
  78. end
  79. end
  80. end)
  81.  
  82. UserInputService.InputEnded:connect(function(InputObject, GameProcessedEvent)
  83. if (not GameProcessedEvent) then
  84. if (InputObject.UserInputType == Enum.UserInputType.Keyboard) then
  85. Keys[InputObject.KeyCode.Name] = false
  86. end
  87. end
  88. end)
  89.  
  90. game:GetService("RunService").RenderStepped:connect(function()
  91. if (CurrentCharacter and (CurrentCharacter.Parent == workspace)) then
  92. if Keys.Space then
  93. local Humanoid = CurrentCharacter:FindFirstChild("Humanoid")
  94. if Humanoid then
  95. Humanoid.Jump = true
  96. end
  97. end
  98. if (Keys.A or Keys.D) then
  99. local Torso = CurrentCharacter:FindFirstChild("Torso")
  100. if Torso then
  101. Torso.CFrame = (Torso.CFrame * CFrame.Angles(0, math.rad(Keys.A and 2 or Keys.D and -2), 0))
  102. end
  103. end
  104. local Humanoid = CurrentCharacter:FindFirstChild("Humanoid")
  105. if Humanoid then
  106. Humanoid:Move(Vector3.new(0, 0, (Keys.W and -1 or Keys.D and 1)), true)
  107. else
  108. Humanoid:Move(Vector3.new(0, 0, 0), true)
  109. end
  110. end
  111. end)
  112.  
  113. CurrentCharacter = SetupCharacter()
  114.  
  115. Player.Chatted:connect(function(Message)
  116. if (CurrentCharacter and (CurrentCharacter.Parent == workspace)) then
  117. local Head = CurrentCharacter:FindFirstChild("Head")
  118. if Head then
  119. game.Chat:Chat(Head, Message, math.random(0, 2))
  120. end
  121. end
  122. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement