Advertisement
Hex4rr

Hat Animation Helper

Nov 12th, 2020
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.34 KB | None | 0 0
  1. -- HAT NEEDED:
  2.  
  3. -- https://web.roblox.com/catalog/4315489767/Demonic-Greatsword\
  4.  
  5. -- PRESS E TO ATTACK
  6.  
  7. -- Flinging Tool
  8. -- Checking Sequence
  9. local value = Instance.new("NumberValue")
  10. for _,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  11. if (v:IsA("Accessory")) then
  12. value.Value = value.Value +1
  13. end
  14. end
  15. wait()
  16. print(value.Value)
  17. wait()
  18. if value.Value == 2 then
  19. game.Players.LocalPlayer.Character.Head:Destroy()
  20. spawn(function()
  21. local message = Instance.new("Message",workspace)
  22. message.Text = "ERROR"
  23. wait(1)
  24. message:Destroy()
  25. end)
  26. wait(1)
  27. spawn(function()
  28. local message = Instance.new("Message",workspace)
  29. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  30. wait(4)
  31. message:Destroy()
  32. end)
  33. end
  34.  
  35. if value.Value == 3 then
  36. game.Players.LocalPlayer.Character.Head:Destroy()
  37. spawn(function()
  38. local message = Instance.new("Message",workspace)
  39. message.Text = "ERROR"
  40. wait(1)
  41. message:Destroy()
  42. end)
  43. wait(1)
  44. spawn(function()
  45. local message = Instance.new("Message",workspace)
  46. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  47. wait(4)
  48. message:Destroy()
  49. end)
  50. end
  51.  
  52. if value.Value == 4 then
  53. game.Players.LocalPlayer.Character.Head:Destroy()
  54. spawn(function()
  55. local message = Instance.new("Message",workspace)
  56. message.Text = "ERROR"
  57. wait(1)
  58. message:Destroy()
  59. end)
  60. wait(1)
  61. spawn(function()
  62. local message = Instance.new("Message",workspace)
  63. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  64. wait(4)
  65. message:Destroy()
  66. end)
  67. end
  68.  
  69. if value.Value == 5 then
  70. game.Players.LocalPlayer.Character.Head:Destroy()
  71. spawn(function()
  72. local message = Instance.new("Message",workspace)
  73. message.Text = "ERROR"
  74. wait(1)
  75. message:Destroy()
  76. end)
  77. wait(1)
  78. spawn(function()
  79. local message = Instance.new("Message",workspace)
  80. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  81. wait(4)
  82. message:Destroy()
  83. end)
  84. end
  85.  
  86. if value.Value == 6 then
  87. game.Players.LocalPlayer.Character.Head:Destroy()
  88. spawn(function()
  89. local message = Instance.new("Message",workspace)
  90. message.Text = "ERROR"
  91. wait(1)
  92. message:Destroy()
  93. end)
  94. wait(1)
  95. spawn(function()
  96. local message = Instance.new("Message",workspace)
  97. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  98. wait(4)
  99. message:Destroy()
  100. end)
  101. end
  102.  
  103. if value.Value == 7 then
  104. game.Players.LocalPlayer.Character.Head:Destroy()
  105. spawn(function()
  106. local message = Instance.new("Message",workspace)
  107. message.Text = "ERROR"
  108. wait(1)
  109. message:Destroy()
  110. end)
  111. wait(1)
  112. spawn(function()
  113. local message = Instance.new("Message",workspace)
  114. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  115. wait(4)
  116. message:Destroy()
  117. end)
  118. end
  119.  
  120. if value.Value == 8 then
  121. game.Players.LocalPlayer.Character.Head:Destroy()
  122. spawn(function()
  123. local message = Instance.new("Message",workspace)
  124. message.Text = "ERROR"
  125. wait(1)
  126. message:Destroy()
  127. end)
  128. wait(1)
  129. spawn(function()
  130. local message = Instance.new("Message",workspace)
  131. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  132. wait(4)
  133. message:Destroy()
  134. end)
  135. end
  136.  
  137. if value.Value == 9 then
  138. game.Players.LocalPlayer.Character.Head:Destroy()
  139. spawn(function()
  140. local message = Instance.new("Message",workspace)
  141. message.Text = "ERROR"
  142. wait(1)
  143. message:Destroy()
  144. end)
  145. wait(1)
  146. spawn(function()
  147. local message = Instance.new("Message",workspace)
  148. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  149. wait(4)
  150. message:Destroy()
  151. end)
  152. end
  153.  
  154. if value.Value == 10 then
  155. game.Players.LocalPlayer.Character.Head:Destroy()
  156. spawn(function()
  157. local message = Instance.new("Message",workspace)
  158. message.Text = "ERROR"
  159. wait(1)
  160. message:Destroy()
  161. end)
  162. wait(1)
  163. spawn(function()
  164. local message = Instance.new("Message",workspace)
  165. message.Text = "PLEASE USE ONE HAT. (value.Value surpassed 1) .. HAT AMMOUNT: " .. value.Value
  166. wait(4)
  167. message:Destroy()
  168. end)
  169. end
  170. -- Main Animation
  171. --[[
  172. local Anim = Instance.new("Animation")
  173. Anim.AnimationId = "rbxassetid://182393478"
  174. local track = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Anim)
  175. track:Play(.1, 1, 1)
  176. ]]
  177. -- Hat Position
  178.  
  179. local Xval = Instance.new("NumberValue")
  180. local Yval = Instance.new("NumberValue")
  181. local Zval = Instance.new("NumberValue")
  182.  
  183. local XvalO = Instance.new("NumberValue")
  184. local YvalO = Instance.new("NumberValue")
  185. local ZvalO = Instance.new("NumberValue")
  186.  
  187. local num3 = Instance.new("NumberValue")
  188. local ori = Instance.new("NumberValue")
  189. local an = Instance.new("NumberValue")
  190. local toggle = true
  191.  
  192. local angular = Vector3.new(0,0,0)
  193. ori.Value = 100
  194. num3.Value = 0
  195.  
  196. Xval.Value = 0
  197. Yval.Value = -1
  198. Zval.Value = 2
  199.  
  200. XvalO.Value = 0
  201. YvalO.Value = 0
  202. ZvalO.Value = 0
  203.  
  204. local plr = game.Players.LocalPlayer;
  205. local chr = plr.Character;
  206. local hum = chr.Humanoid;
  207. local mov = {};
  208. local mov2 = {};
  209.  
  210. coroutine.resume(coroutine.create(function()
  211. settings().Physics.AllowSleep = false;
  212. game.RunService.RenderStepped:Connect(function()
  213. for i, v in pairs(game.Players:GetPlayers()) do
  214. if v ~= plr then
  215. v.MaximumSimulationRadius = 0.1;
  216. v.SimulationRadius = 0;
  217. else
  218. v.MaximumSimulationRadius = math.pow(math.huge, math.huge);
  219. v.SimulationRadius = math.pow(math.huge, 2);
  220. end
  221. end
  222. end)
  223. end))
  224.  
  225. for _, v in pairs(hum:GetAccessories()) do
  226. local b = v.Handle;
  227. b.CanCollide = false;
  228. b:BreakJoints();
  229. for _, k in pairs(v:GetChildren()) do
  230. if not k:IsA'SpecialMesh' and not k:IsA'Part' then
  231. k:Destroy();
  232. end
  233. end
  234. local still = Instance.new('BodyAngularVelocity', b);
  235. local align = Instance.new('AlignPosition', b);
  236. align.RigidityEnabled = true;
  237. local a0 = Instance.new('Attachment', b);
  238. local a1 = Instance.new('Attachment', chr.Head);
  239. align.Attachment0 = a0;
  240. align.Attachment1 = a1;
  241. table.insert(mov, a1);
  242. table.insert(mov2, still);
  243. end
  244.  
  245. local mode = 1;
  246. local l = 1;
  247. game['Run Service'].RenderStepped:Connect(function()
  248. if mode == 1 then
  249. for _, v in pairs(mov) do
  250. v.Position = Vector3.new(Xval.Value, Yval.Value, Zval.Value);
  251. end
  252. end
  253. end)
  254. local tool = plr.Backpack:findFirstChildOfClass("Tool")
  255.  
  256.  
  257. local ScreenGui = Instance.new("ScreenGui")
  258. local Dragging = Instance.new("Frame")
  259. local Exit = Instance.new("TextButton")
  260. local BG = Instance.new("Frame")
  261. local Set = Instance.new("TextButton")
  262. local XPos = Instance.new("TextBox")
  263. local XOri = Instance.new("TextBox")
  264. local YOri = Instance.new("TextBox")
  265. local YPos = Instance.new("TextBox")
  266. local ZPos = Instance.new("TextBox")
  267. local ZOri = Instance.new("TextBox")
  268.  
  269. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  270. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  271. ScreenGui.ResetOnSpawn = false
  272.  
  273. Dragging.Name = "Dragging"
  274. Dragging.Parent = ScreenGui
  275. Dragging.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  276. Dragging.BackgroundTransparency = 0.800
  277. Dragging.BorderSizePixel = 0
  278. Dragging.Position = UDim2.new(0, 0, 0.400491387, 0)
  279. Dragging.Size = UDim2.new(0, 181, 0, 24)
  280. Dragging.Active = true
  281. Dragging.Draggable = true
  282. Dragging.Selectable = true
  283.  
  284. Exit.Name = "Exit"
  285. Exit.Parent = Dragging
  286. Exit.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  287. Exit.BackgroundTransparency = 1.000
  288. Exit.Position = UDim2.new(0.802137554, 0, 0, 0)
  289. Exit.Size = UDim2.new(0, 35, 0, 24)
  290. Exit.Font = Enum.Font.SourceSans
  291. Exit.Text = "X"
  292. Exit.TextColor3 = Color3.fromRGB(0, 0, 0)
  293. Exit.TextScaled = true
  294. Exit.TextSize = 14.000
  295. Exit.TextWrapped = true
  296. Exit.MouseButton1Click:Connect(function()
  297. ScreenGui:Destroy()
  298. end)
  299.  
  300. BG.Name = "BG"
  301. BG.Parent = Dragging
  302. BG.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  303. BG.BackgroundTransparency = 0.800
  304. BG.BorderSizePixel = 0
  305. BG.Position = UDim2.new(0, 0, 1, 0)
  306. BG.Size = UDim2.new(0, 181, 0, 328)
  307.  
  308. Set.Name = "Set"
  309. Set.Parent = BG
  310. Set.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  311. Set.BackgroundTransparency = 0.800
  312. Set.Position = UDim2.new(0, 0, 0.945121944, 0)
  313. Set.Size = UDim2.new(0, 181, 0, 18)
  314. Set.Font = Enum.Font.Arial
  315. Set.Text = "Set Position"
  316. Set.TextColor3 = Color3.fromRGB(0, 0, 0)
  317. Set.TextScaled = true
  318. Set.TextSize = 14.000
  319. Set.TextWrapped = true
  320. Set.MouseButton1Click:connect(function()
  321. Xval.Value = XPos.Text
  322. Yval.Value = YPos.Text
  323. Zval.Value = ZPos.Text
  324.  
  325. XvalO.Value = XOri.Text
  326. YvalO.Value = YOri.Text
  327. ZvalO.Value = ZOri.Text
  328. end)
  329.  
  330. XPos.Name = "XPos"
  331. XPos.Parent = BG
  332. XPos.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  333. XPos.BackgroundTransparency = 0.800
  334. XPos.Size = UDim2.new(0, 79, 0, 50)
  335. XPos.Font = Enum.Font.SourceSans
  336. XPos.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  337. XPos.PlaceholderText = "X Position"
  338. XPos.Text = ""
  339. XPos.TextColor3 = Color3.fromRGB(255, 255, 255)
  340. XPos.TextSize = 14.000
  341.  
  342. XOri.Name = "XOri"
  343. XOri.Parent = BG
  344. XOri.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  345. XOri.BackgroundTransparency = 0.800
  346. XOri.Position = UDim2.new(0.558011055, 0, 0, 0)
  347. XOri.Size = UDim2.new(0, 79, 0, 50)
  348. XOri.Font = Enum.Font.SourceSans
  349. XOri.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  350. XOri.PlaceholderText = "X Orientation"
  351. XOri.Text = ""
  352. XOri.TextColor3 = Color3.fromRGB(255, 255, 255)
  353. XOri.TextSize = 14.000
  354.  
  355. YOri.Name = "YOri"
  356. YOri.Parent = BG
  357. YOri.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  358. YOri.BackgroundTransparency = 0.800
  359. YOri.Position = UDim2.new(0.558011055, 0, 0.38719514, 0)
  360. YOri.Size = UDim2.new(0, 79, 0, 50)
  361. YOri.Font = Enum.Font.SourceSans
  362. YOri.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  363. YOri.PlaceholderText = "Y Orientation"
  364. YOri.Text = ""
  365. YOri.TextColor3 = Color3.fromRGB(255, 255, 255)
  366. YOri.TextSize = 14.000
  367.  
  368. YPos.Name = "YPos"
  369. YPos.Parent = BG
  370. YPos.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  371. YPos.BackgroundTransparency = 0.800
  372. YPos.Position = UDim2.new(0, 0, 0.38719514, 0)
  373. YPos.Size = UDim2.new(0, 79, 0, 50)
  374. YPos.Font = Enum.Font.SourceSans
  375. YPos.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  376. YPos.PlaceholderText = "Y Position"
  377. YPos.Text = ""
  378. YPos.TextColor3 = Color3.fromRGB(255, 255, 255)
  379. YPos.TextSize = 14.000
  380.  
  381. ZPos.Name = "ZPos"
  382. ZPos.Parent = BG
  383. ZPos.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  384. ZPos.BackgroundTransparency = 0.800
  385. ZPos.Position = UDim2.new(0, 0, 0.792682946, 0)
  386. ZPos.Size = UDim2.new(0, 79, 0, 50)
  387. ZPos.Font = Enum.Font.SourceSans
  388. ZPos.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  389. ZPos.PlaceholderText = "Z Position"
  390. ZPos.Text = ""
  391. ZPos.TextColor3 = Color3.fromRGB(255, 255, 255)
  392. ZPos.TextSize = 14.000
  393.  
  394. ZOri.Name = "ZOri"
  395. ZOri.Parent = BG
  396. ZOri.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  397. ZOri.BackgroundTransparency = 0.800
  398. ZOri.Position = UDim2.new(0.558011055, 0, 0.792682946, 0)
  399. ZOri.Size = UDim2.new(0, 79, 0, 50)
  400. ZOri.Font = Enum.Font.SourceSans
  401. ZOri.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  402. ZOri.PlaceholderText = "Z Orientation"
  403. ZOri.Text = ""
  404. ZOri.TextColor3 = Color3.fromRGB(255, 255, 255)
  405. ZOri.TextSize = 14.000
  406.  
  407. local function orie()
  408. while wait() do
  409. if chr.Humanoid.Health == 0 then
  410. toggle = false
  411. end
  412. for _, v in pairs(hum:GetAccessories()) do
  413. local b = v.Handle;
  414. b.Orientation = Vector3.new(plr.Character.Head.Orientation.X + XvalO.Value, plr.Character.Head.Orientation.Y + YvalO.Value, plr.Character.Head.Orientation.Z + ZvalO.Value)
  415. end
  416. end
  417. end
  418.  
  419. for _, v in pairs(mov2) do
  420. v.AngularVelocity = angular;
  421. end
  422.  
  423. orie()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement