sIendytubble

Minecraft Creeper Script

Jun 15th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.97 KB | None | 0 0
  1. -- creeper --
  2.  
  3. -- left click to blow up
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,game,owner = owner,game
  6. local RealPlayer = Player
  7. do
  8. print("FE Compatibility code by Mokiros")
  9. local rp = RealPlayer
  10. script.Parent = rp.Character
  11.  
  12. --RemoteEvent for communicating
  13. local Event = Instance.new("RemoteEvent")
  14. Event.Name = "UserInput_Event"
  15.  
  16. --Fake event to make stuff like Mouse.KeyDown work
  17. local function fakeEvent()
  18. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  19. t.connect = t.Connect
  20. return t
  21. end
  22.  
  23. --Creating fake input objects with fake variables
  24. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  25. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  26. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  27. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  28. end}
  29. --Merged 2 functions into one by checking amount of arguments
  30. CAS.UnbindAction = CAS.BindAction
  31.  
  32. --This function will trigger the events that have been :Connect()'ed
  33. local function te(self,ev,...)
  34. local t = m[ev]
  35. if t and t._fakeEvent then
  36. for _,f in pairs(t.Functions) do
  37. f(...)
  38. end
  39. end
  40. end
  41. m.TrigEvent = te
  42. UIS.TrigEvent = te
  43.  
  44. Event.OnServerEvent:Connect(function(plr,io)
  45. if plr~=rp then return end
  46. m.Target = io.Target
  47. m.Hit = io.Hit
  48. if not io.isMouse then
  49. local b = io.UserInputState == Enum.UserInputState.Begin
  50. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  51. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  52. end
  53. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  54. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  55. end
  56. for _,t in pairs(CAS.Actions) do
  57. for _,k in pairs(t.Keys) do
  58. if k==io.KeyCode then
  59. t.Function(t.Name,io.UserInputState,io)
  60. end
  61. end
  62. end
  63. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  64. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  65. end
  66. end)
  67. Event.Parent = NLS([==[
  68. local Player = game:GetService("Players").LocalPlayer
  69. local Event = script:WaitForChild("UserInput_Event")
  70. local Mouse = Player:GetMouse()
  71. local UIS = game:GetService("UserInputService")
  72. local input = function(io,a)
  73. if a then return end
  74. --Since InputObject is a client-side instance, we create and pass table instead
  75. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  76. end
  77. UIS.InputBegan:Connect(input)
  78. UIS.InputEnded:Connect(input)
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then
  98. return typeof(s[k])=="function"
  99. and function(_,...)return s[k](s,...)end or s[k]
  100. end
  101. end,
  102. __newindex = function(self,k,v)
  103. local s = rawget(self,"_RealService")
  104. if s then s[k]=v end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return rawget(self,s) or _rg:GetService(s)
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. RunService = FakeService({
  123. _btrs = {},
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132. }
  133. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  134. g.service = g.GetService
  135. FakeService(g,game)
  136. --Changing owner to fake player object to support owner:GetMouse()
  137. game,owner = g,g.Players.LocalPlayer
  138. end
  139. NLS([[warn(left click to blow up)]],owner.Character)
  140. creeper = game.Players.LocalPlayer
  141. awman = creeper.Character
  142. Model0 = awman
  143. Part1 = Model0["Right Arm"]
  144. Decal2 = Instance.new("Decal")
  145. Texture3 = Instance.new("Texture")
  146. Texture4 = Instance.new("Texture")
  147. Texture5 = Instance.new("Texture")
  148. Texture6 = Instance.new("Texture")
  149. Texture7 = Instance.new("Texture")
  150. Part8 = Model0["Left Arm"]
  151. Decal9 = Instance.new("Decal")
  152. Texture10 = Instance.new("Texture")
  153. Texture11 = Instance.new("Texture")
  154. Texture12 = Instance.new("Texture")
  155. Texture13 = Instance.new("Texture")
  156. Texture14 = Instance.new("Texture")
  157. Part15 = Model0["Right Leg"]
  158. Decal16 = Instance.new("Decal")
  159. Texture17 = Instance.new("Texture")
  160. Texture18 = Instance.new("Texture")
  161. Texture19 = Instance.new("Texture")
  162. Texture20 = Instance.new("Texture")
  163. Texture21 = Instance.new("Texture")
  164. Part22 = Model0["Left Leg"]
  165. Decal23 = Instance.new("Decal")
  166. Texture24 = Instance.new("Texture")
  167. Texture25 = Instance.new("Texture")
  168. Texture26 = Instance.new("Texture")
  169. Texture27 = Instance.new("Texture")
  170. Texture28 = Instance.new("Texture")
  171. Part29 = Model0.Torso
  172. Sound30 = Instance.new("Sound")
  173. Weld31 = Instance.new("Weld")
  174. Texture32 = Instance.new("Texture")
  175. Texture33 = Instance.new("Texture")
  176. Texture34 = Instance.new("Texture")
  177. Texture35 = Instance.new("Texture")
  178. Texture36 = Instance.new("Texture")
  179. Texture37 = Instance.new("Texture")
  180. Part38 = Model0.Head
  181. Part38:ClearAllChildren()
  182. Texture39 = Instance.new("Texture")
  183. Texture40 = Instance.new("Texture")
  184. Texture41 = Instance.new("Texture")
  185. Texture42 = Instance.new("Texture")
  186. Texture43 = Instance.new("Texture")
  187. Texture44 = Instance.new("Texture")
  188. local pos = Model0.HumanoidRootPart.CFrame
  189. Part45 = Instance.new("Part")
  190. Decal46 = Instance.new("Decal")
  191. Weld47 = Instance.new("Weld")
  192. SpecialMesh48 = Instance.new("SpecialMesh")
  193. Humanoid49 = Model0.Humanoid
  194. Part1.Name = "Right Arm"
  195. Part1.Parent = Model0
  196. Part1.CFrame = CFrame.new(1345.75, 1164.79016, -34.9391785, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  197. Part1.Orientation = Vector3.new(0, -180, 0)
  198. Part1.Position = Vector3.new(1345.75, 1164.79016, -34.9391785)
  199. Part1.Rotation = Vector3.new(180, 0, -180)
  200. Part1.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  201. Part1.Size = Vector3.new(1, 1, 1)
  202. Part1.BottomSurface = Enum.SurfaceType.Smooth
  203. Part1.BrickColor = BrickColor.new("Camo")
  204. Part1.Material = Enum.Material.Ice
  205. Part1.TopSurface = Enum.SurfaceType.Smooth
  206. Part1.brickColor = BrickColor.new("Camo")
  207. Decal2.Name = "Creeper foot"
  208. Decal2.Parent = Part1
  209. Decal2.Texture = "http://www.roblox.com/asset/?id=84358512"
  210. Texture3.Parent = Part1
  211. Texture3.Texture = "http://www.roblox.com/asset/?id=39643864"
  212. Texture3.Face = Enum.NormalId.Back
  213. Texture4.Parent = Part1
  214. Texture4.Texture = "http://www.roblox.com/asset/?id=39643864"
  215. Texture4.Face = Enum.NormalId.Top
  216. Texture5.Parent = Part1
  217. Texture5.Texture = "http://www.roblox.com/asset/?id=39643864"
  218. Texture5.Face = Enum.NormalId.Bottom
  219. Texture6.Parent = Part1
  220. Texture6.Texture = "http://www.roblox.com/asset/?id=39643864"
  221. Texture6.Face = Enum.NormalId.Right
  222. Texture7.Parent = Part1
  223. Texture7.Texture = "http://www.roblox.com/asset/?id=39643864"
  224. Texture7.Face = Enum.NormalId.Left
  225. Part8.Name = "Left Arm"
  226. Part8.Parent = Model0
  227. Part8.CFrame = CFrame.new(1346.75, 1164.79016, -34.9391785, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  228. Part8.Orientation = Vector3.new(0, -180, 0)
  229. Part8.Position = Vector3.new(1346.75, 1164.79016, -34.9391785)
  230. Part8.Rotation = Vector3.new(180, 0, -180)
  231. Part8.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  232. Part8.Size = Vector3.new(1, 1, 1)
  233. Part8.BottomSurface = Enum.SurfaceType.Smooth
  234. Part8.BrickColor = BrickColor.new("Camo")
  235. Part8.Material = Enum.Material.Ice
  236. Part8.TopSurface = Enum.SurfaceType.Smooth
  237. Part8.brickColor = BrickColor.new("Camo")
  238. Decal9.Name = "Creeper foot"
  239. Decal9.Parent = Part8
  240. Decal9.Texture = "http://www.roblox.com/asset/?id=84358512"
  241. Texture10.Parent = Part8
  242. Texture10.Texture = "http://www.roblox.com/asset/?id=39643864"
  243. Texture10.Face = Enum.NormalId.Bottom
  244. Texture11.Parent = Part8
  245. Texture11.Texture = "http://www.roblox.com/asset/?id=39643864"
  246. Texture11.Face = Enum.NormalId.Top
  247. Texture12.Parent = Part8
  248. Texture12.Texture = "http://www.roblox.com/asset/?id=39643864"
  249. Texture12.Face = Enum.NormalId.Back
  250. Texture13.Parent = Part8
  251. Texture13.Texture = "http://www.roblox.com/asset/?id=39643864"
  252. Texture13.Face = Enum.NormalId.Right
  253. Texture14.Parent = Part8
  254. Texture14.Texture = "http://www.roblox.com/asset/?id=39643864"
  255. Texture14.Face = Enum.NormalId.Left
  256. Part15.Name = "Right Leg"
  257. Part15.Parent = Model0
  258. Part15.CFrame = CFrame.new(1345.75, 1164.79016, -36.9391785, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  259. Part15.Orientation = Vector3.new(0, -180, 0)
  260. Part15.Position = Vector3.new(1345.75, 1164.79016, -36.9391785)
  261. Part15.Rotation = Vector3.new(180, 0, -180)
  262. Part15.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  263. Part15.Size = Vector3.new(1, 1, 1)
  264. Part15.BottomSurface = Enum.SurfaceType.Smooth
  265. Part15.BrickColor = BrickColor.new("Camo")
  266. Part15.Material = Enum.Material.Ice
  267. Part15.TopSurface = Enum.SurfaceType.Smooth
  268. Part15.brickColor = BrickColor.new("Camo")
  269. Decal16.Name = "Creeper foot"
  270. Decal16.Parent = Part15
  271. Decal16.Texture = "http://www.roblox.com/asset/?id=84358512"
  272. Texture17.Parent = Part15
  273. Texture17.Texture = "http://www.roblox.com/asset/?id=39643864"
  274. Texture17.Face = Enum.NormalId.Bottom
  275. Texture18.Parent = Part15
  276. Texture18.Texture = "http://www.roblox.com/asset/?id=39643864"
  277. Texture18.Face = Enum.NormalId.Top
  278. Texture19.Parent = Part15
  279. Texture19.Texture = "http://www.roblox.com/asset/?id=39643864"
  280. Texture19.Face = Enum.NormalId.Back
  281. Texture20.Parent = Part15
  282. Texture20.Texture = "http://www.roblox.com/asset/?id=39643864"
  283. Texture20.Face = Enum.NormalId.Right
  284. Texture21.Parent = Part15
  285. Texture21.Texture = "http://www.roblox.com/asset/?id=39643864"
  286. Texture21.Face = Enum.NormalId.Left
  287. Part22.Name = "Left Leg"
  288. Part22.Parent = Model0
  289. Part22.CFrame = CFrame.new(1346.75, 1164.79016, -36.9391785, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  290. Part22.Orientation = Vector3.new(0, -180, 0)
  291. Part22.Position = Vector3.new(1346.75, 1164.79016, -36.9391785)
  292. Part22.Rotation = Vector3.new(180, 0, -180)
  293. Part22.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  294. Part22.Size = Vector3.new(1, 1, 1)
  295. Part22.BottomSurface = Enum.SurfaceType.Smooth
  296. Part22.BrickColor = BrickColor.new("Camo")
  297. Part22.Material = Enum.Material.Ice
  298. Part22.TopSurface = Enum.SurfaceType.Smooth
  299. Part22.brickColor = BrickColor.new("Camo")
  300. Decal23.Name = "Creeper foot"
  301. Decal23.Parent = Part22
  302. Decal23.Texture = "http://www.roblox.com/asset/?id=84358512"
  303. Texture24.Parent = Part22
  304. Texture24.Texture = "http://www.roblox.com/asset/?id=39643864"
  305. Texture24.Face = Enum.NormalId.Bottom
  306. Texture25.Parent = Part22
  307. Texture25.Texture = "http://www.roblox.com/asset/?id=39643864"
  308. Texture25.Face = Enum.NormalId.Top
  309. Texture26.Parent = Part22
  310. Texture26.Texture = "http://www.roblox.com/asset/?id=39643864"
  311. Texture26.Face = Enum.NormalId.Back
  312. Texture27.Parent = Part22
  313. Texture27.Texture = "http://www.roblox.com/asset/?id=39643864"
  314. Texture27.Face = Enum.NormalId.Right
  315. Texture28.Parent = Part22
  316. Texture28.Texture = "http://www.roblox.com/asset/?id=39643864"
  317. Texture28.Face = Enum.NormalId.Left
  318. Part29.Name = "Torso"
  319. Part29.Parent = Model0
  320. Part29.CFrame = CFrame.new(1346.25, 1166.79016, -35.9391785, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  321. Part29.Orientation = Vector3.new(0, 180, 0)
  322. Part29.Position = Vector3.new(1346.25, 1166.79016, -35.9391785)
  323. Part29.Rotation = Vector3.new(-180, 0, -180)
  324. Part29.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  325. Part29.Size = Vector3.new(2, 3, 1)
  326. Part29.BottomSurface = Enum.SurfaceType.Smooth
  327. Part29.BrickColor = BrickColor.new("Camo")
  328. Part29.Material = Enum.Material.Ice
  329. Part29.TopSurface = Enum.SurfaceType.Weld
  330. Part29.brickColor = BrickColor.new("Camo")
  331. Sound30.Name = "Sizzle"
  332. Sound30.Parent = Part29
  333. Sound30.Pitch = 2
  334. Sound30.PlaybackSpeed = 2
  335. Sound30.SoundId = "http://www.roblox.com/asset/?id=1369158"
  336. Sound30.Volume = 1
  337. Weld31.Parent = Part29
  338. Weld31.C0 = CFrame.new(0, 1.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  339. Weld31.C1 = CFrame.new(0, -1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  340. Weld31.Part0 = Part29
  341. Weld31.Part1 = Part38
  342. Weld31.part1 = Part38
  343. Texture32.Parent = Part29
  344. Texture32.Texture = "http://www.roblox.com/asset/?id=39643864"
  345. Texture32.Face = Enum.NormalId.Right
  346. Texture33.Parent = Part29
  347. Texture33.Texture = "http://www.roblox.com/asset/?id=39643864"
  348. Texture33.Face = Enum.NormalId.Left
  349. Texture34.Parent = Part29
  350. Texture34.Texture = "http://www.roblox.com/asset/?id=39643864"
  351. Texture35.Parent = Part29
  352. Texture35.Texture = "http://www.roblox.com/asset/?id=39643864"
  353. Texture35.Face = Enum.NormalId.Back
  354. Texture36.Parent = Part29
  355. Texture36.Texture = "http://www.roblox.com/asset/?id=39643864"
  356. Texture36.Face = Enum.NormalId.Top
  357. Texture37.Parent = Part29
  358. Texture37.Texture = "http://www.roblox.com/asset/?id=39643864"
  359. Texture37.Face = Enum.NormalId.Bottom
  360. Part38.Name = "Head"
  361. Part38.Parent = Model0
  362. Part38.CFrame = CFrame.new(1346.25, 1169.29016, -35.9391785, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  363. Part38.Orientation = Vector3.new(0, 180, 0)
  364. Part38.Position = Vector3.new(1346.25, 1169.29016, -35.9391785)
  365. Part38.Rotation = Vector3.new(-180, 0, -180)
  366. Part38.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  367. Part38.Size = Vector3.new(2, 2, 2)
  368. Part38.BottomSurface = Enum.SurfaceType.Smooth
  369. Part38.BrickColor = BrickColor.new("Camo")
  370. Part38.Material = Enum.Material.Ice
  371. Part38.TopSurface = Enum.SurfaceType.Smooth
  372. Part38.brickColor = BrickColor.new("Camo")
  373. Texture39.Parent = Part38
  374. Texture39.Texture = "http://www.roblox.com/asset/?id=39643864"
  375. Texture39.Face = Enum.NormalId.Right
  376. Texture40.Parent = Part38
  377. Texture40.Texture = "http://www.roblox.com/asset/?id=39643864"
  378. Texture40.Face = Enum.NormalId.Left
  379. Texture41.Parent = Part38
  380. Texture41.Texture = "http://www.roblox.com/asset/?id=39643864"
  381. Texture42.Parent = Part38
  382. Texture42.Texture = "http://www.roblox.com/asset/?id=39643864"
  383. Texture42.Face = Enum.NormalId.Back
  384. Texture43.Parent = Part38
  385. Texture43.Texture = "http://www.roblox.com/asset/?id=39643864"
  386. Texture43.Face = Enum.NormalId.Top
  387. Texture44.Parent = Part38
  388. Texture44.Texture = "http://www.roblox.com/asset/?id=39643864"
  389. Texture44.Face = Enum.NormalId.Bottom
  390. Part45.Name = "face"
  391. Part45.Parent = Part38
  392. Part45.CFrame = CFrame.new(1346.25, 1169.29016, -35.9391785, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  393. Part45.Orientation = Vector3.new(0, 180, 0)
  394. Part45.Position = Vector3.new(1346.25, 1169.29016, -35.9391785)
  395. Part45.Rotation = Vector3.new(-180, 0, -180)
  396. Part45.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  397. Part45.Transparency = 1
  398. Part45.Size = Vector3.new(2, 2, 2)
  399. Part45.BottomSurface = Enum.SurfaceType.Smooth
  400. Part45.BrickColor = BrickColor.new("Camo")
  401. Part45.Material = Enum.Material.Ice
  402. Part45.TopSurface = Enum.SurfaceType.Smooth
  403. Part45.brickColor = BrickColor.new("Camo")
  404. Decal46.Parent = Part45
  405. Decal46.Texture = "http://www.roblox.com/asset/?id=50018586"
  406. Weld47.Parent = Part45
  407. Weld47.Part0 = Part38
  408. Weld47.Part1 = Part45
  409. Weld47.part1 = Part45
  410. SpecialMesh48.Parent = Part45
  411. SpecialMesh48.Offset = Vector3.new(0, 0, -0.00100000005)
  412. SpecialMesh48.MeshType = Enum.MeshType.Brick
  413. Humanoid49.Parent = Model0
  414. Humanoid49.LeftLeg = Part22
  415. Humanoid49.RightLeg = Part15
  416. Humanoid49.Torso = Part29
  417. Humanoid49.WalkSpeed = 12
  418. Humanoid49.HipHeight = 0.501
  419. awman:WaitForChild("Body Colors").HeadColor = BrickColor.new("White")
  420. awman:WaitForChild("Body Colors").TorsoColor = BrickColor.new("White")
  421. awman:WaitForChild("Body Colors").LeftArmColor = BrickColor.new("White")
  422. awman:WaitForChild("Body Colors").RightArmColor = BrickColor.new("White")
  423. awman:WaitForChild("Body Colors").LeftLegColor = BrickColor.new("White")
  424. awman:WaitForChild("Body Colors").RightLegColor = BrickColor.new("White")
  425. function flashon()
  426. for i,v in pairs(awman:GetChildren()) do
  427. for i,v in pairs(v:GetChildren()) do
  428. if v.ClassName == "Texture" or v.ClassName == "Decal" and v.Texture ~= "http://www.roblox.com/asset/?id=50018586" then
  429. v.Transparency = 1
  430. end
  431. end
  432. end
  433. end
  434. function flashoff()
  435. for i,v in pairs(awman:GetChildren()) do
  436. for i,v in pairs(v:GetChildren()) do
  437. if v.ClassName == "Texture" or v.ClassName == "Decal" and v.Texture ~= "http://www.roblox.com/asset/?id=50018586" then
  438. v.Transparency = 0
  439. end
  440. end
  441. end
  442. end
  443. for i,v in pairs(awman:GetChildren()) do
  444. if v.ClassName == "Shirt" or v.ClassName == "Pants" or v.ClassName == "ShirtGraphic" or v.ClassName == "CharacterMesh" then
  445. v:Destroy()
  446. end
  447. end
  448. for i,v in pairs(awman:GetChildren()) do
  449. if v.ClassName == "Part" then
  450. v.BrickColor = BrickColor.new("White")
  451. end
  452. end
  453. urdead = false
  454. local ticke = 0.8
  455. function blowup()
  456. flashon()
  457. wait(ticke)
  458. flashoff()
  459. ticke = ticke - 0.2
  460. wait(ticke)
  461. flashon()
  462. wait(ticke)
  463. flashoff()
  464. ticke = ticke - 0.2
  465.  
  466. wait(ticke)
  467. flashon()
  468. wait(ticke)
  469. flashoff()
  470. ticke = ticke - 0.2
  471. wait(ticke)
  472. flashon()
  473. wait(ticke)
  474. ticke = ticke - 0.2
  475. flashon()
  476. wait(ticke)
  477. flashoff()
  478. ticke = ticke - 0.2
  479. wait(ticke)
  480. flashon()
  481. wait(ticke)
  482. flashoff()
  483. ticke = ticke - 0.2
  484.  
  485. wait(ticke)
  486. flashon()
  487. wait(ticke)
  488. flashoff()
  489. ticke = ticke - 0.2
  490. wait(ticke)
  491. flashon()
  492. wait(ticke)
  493. ticke = ticke - 0.2
  494. flashon()
  495. wait(ticke)
  496. flashoff()
  497. ticke = ticke - 0.2
  498. wait(ticke)
  499. flashon()
  500. wait(ticke)
  501. flashoff()
  502. ticke = ticke - 0.2
  503.  
  504. wait(ticke)
  505. flashon()
  506. wait(ticke)
  507. flashoff()
  508. ticke = ticke - 0.2
  509. wait(ticke)
  510. flashon()
  511. wait(ticke)
  512. coroutine.resume(coroutine.create(function()
  513. while wait() do
  514. for i,v in pairs(awman:GetChildren()) do
  515. if v.ClassName == "Part" then
  516. v.Size = v.Size + Vector3.new(0.005,0.005,0.005)
  517. end
  518. end
  519. end
  520. end))
  521. ticke = ticke - 0.2
  522. wait(ticke)
  523. ticke = ticke - 0.2
  524. wait(0.5)
  525. kabooyah = Instance.new("Explosion",workspace)
  526. kabooyah.Position = awman.HumanoidRootPart.Position
  527. kabooyah.BlastPressure = 25000
  528. kabooyah.BlastRadius = 25
  529. kabooyah.Hit:Connect(function(part)
  530. part.Anchored = false
  531. part:BreakJoints()
  532. end)
  533. for i,v in pairs(awman:GetChildren()) do
  534. if v.ClassName == "Part" then
  535. v:Destroy()
  536. end
  537. end
  538. end
  539. wait()
  540. mouse = creeper:GetMouse()
  541. mouse.Button1Down:Connect(function()
  542. if urdead == false then
  543. urdead = true
  544. blowup()
  545. end
  546. end)
  547. Model0.HumanoidRootPart.CFrame = pos
  548. function waitForChild(parent, childName)
  549. local child = parent:findFirstChild(childName)
  550. if child then return child end
  551. while true do
  552. child = parent.ChildAdded:wait()
  553. if child.Name==childName then return child end
  554. end
  555. end
  556.  
  557. -- ANIMATION
  558.  
  559. -- declarations
  560. local guy = awman
  561. local rs0 = CFrame.new(1, -1.5, -0.5, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  562. local rs1 = CFrame.new(0.5, 0.5, 0.5, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  563. local ls0 = CFrame.new(-1, -1.5, -0.5, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  564. local ls1 = CFrame.new(-0.5, 0.5, 0.5, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  565. local rh0 = CFrame.new(1, -1.5, 0.5, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  566. local rh1 = CFrame.new(0.5, 0.5, -0.5, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  567. local lh0 = CFrame.new(-1, -1.5, 0.5, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  568. local lh1 = CFrame.new(-0.5, 0.5, -0.5, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  569.  
  570. local m = Instance.new("Motor6D")
  571. m.C0 = lh0
  572. m.C1 = lh1
  573. m.Name = "Left Hip"
  574. m.Part0 = guy.Torso
  575. m.Part1 = guy["Left Leg"]
  576. m.Parent = guy.Torso
  577. m.MaxVelocity = 0.1
  578. local m = Instance.new("Motor6D")
  579. m.C0 = rh0
  580. m.C1 = rh1
  581. m.Name = "Right Hip"
  582. m.Part0 = guy.Torso
  583. m.Part1 = guy["Right Leg"]
  584. m.Parent = guy.Torso
  585. m.MaxVelocity = 0.1
  586. local m = Instance.new("Motor6D")
  587. m.C0 = ls0
  588. m.C1 = ls1
  589. m.Name = "Left Shoulder"
  590. m.Part0 = guy.Torso
  591. m.Part1 = guy["Left Arm"]
  592. m.Parent = guy.Torso
  593. m.MaxVelocity = 0.1
  594. local m = Instance.new("Motor6D")
  595. m.C0 = rs0
  596. m.C1 = rs1
  597. m.Name = "Right Shoulder"
  598. m.Part0 = guy.Torso
  599. m.Part1 = guy["Right Arm"]
  600. m.Parent = guy.Torso
  601. m.MaxVelocity = 0.1
  602. local m = Instance.new("Motor6D")
  603. m.C1 = CFrame.new(0,-2.5,0)
  604. m.Name = "Neck"
  605. m.Part0 = guy.Torso
  606. m.Part1 = guy.Head
  607. m.Parent = guy.Torso
  608. m.MaxVelocity = 0.1
  609.  
  610. local copy = guy:clone()
  611.  
  612. local Figure = awman
  613. local Torso = waitForChild(Figure, "Torso")
  614. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  615. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  616. local RightHip = waitForChild(Torso, "Right Hip")
  617. local LeftHip = waitForChild(Torso, "Left Hip")
  618. local Neck = waitForChild(Torso, "Neck")
  619. local Humanoid = waitForChild(Figure, "Humanoid")
  620. local pose = "Standing"
  621.  
  622. local toolAnim = "None"
  623. local toolAnimTime = 0
  624.  
  625. -- functions
  626.  
  627. function onRunning(speed)
  628. if speed>0 then
  629. pose = "Running"
  630. else
  631. pose = "Standing"
  632. end
  633. end
  634.  
  635. function onDied()
  636. pose = "Dead"
  637. end
  638.  
  639. function onJumping()
  640. pose = "Jumping"
  641. end
  642.  
  643. function onClimbing()
  644. pose = "Climbing"
  645. end
  646.  
  647. function onGettingUp()
  648. pose = "GettingUp"
  649. end
  650.  
  651. function onFreeFall()
  652. pose = "FreeFall"
  653. end
  654.  
  655. function onFallingDown()
  656. pose = "FallingDown"
  657. end
  658.  
  659. function onSeated()
  660. pose = "Seated"
  661. end
  662.  
  663. function onPlatformStanding()
  664. pose = "PlatformStanding"
  665. end
  666.  
  667. function moveJump()
  668. RightShoulder.MaxVelocity = 0.5
  669. LeftShoulder.MaxVelocity = 0.5
  670. RightHip.MaxVelocity = 0.5
  671. LeftHip.MaxVelocity = 0.5
  672. RightShoulder.DesiredAngle = 1
  673. LeftShoulder.DesiredAngle = -1
  674. RightHip.DesiredAngle = -1
  675. LeftHip.DesiredAngle = 1
  676. end
  677.  
  678.  
  679. -- same as jump for now
  680.  
  681. function moveFreeFall()
  682. RightShoulder.MaxVelocity = 0.5
  683. LeftShoulder.MaxVelocity = 0.5
  684. RightHip.MaxVelocity = 0.5
  685. LeftHip.MaxVelocity = 0.5
  686. RightShoulder.DesiredAngle = 1
  687. LeftShoulder.DesiredAngle = -1
  688. RightHip.DesiredAngle = -1
  689. LeftHip.DesiredAngle = 1
  690. end
  691.  
  692. function moveSit()
  693. RightShoulder.MaxVelocity = 0.15
  694. LeftShoulder.MaxVelocity = 0.15
  695. RightShoulder.DesiredAngle = 3.14 /2
  696. LeftShoulder.DesiredAngle = -3.14 /2
  697. RightHip.DesiredAngle = 3.14 /2
  698. LeftHip.DesiredAngle = -3.14 /2
  699. end
  700.  
  701. function getTool()
  702. for _, kid in ipairs(Figure:GetChildren()) do
  703. if kid.className == "Tool" then return kid end
  704. end
  705. return nil
  706. end
  707.  
  708. function getToolAnim(tool)
  709. for _, c in ipairs(tool:GetChildren()) do
  710. if c.Name == "toolanim" and c.className == "StringValue" then
  711. return c
  712. end
  713. end
  714. return nil
  715. end
  716.  
  717. function animateTool()
  718.  
  719. if (toolAnim == "None") then
  720. RightShoulder.DesiredAngle = 1.57
  721. return
  722. end
  723.  
  724. if (toolAnim == "Slash") then
  725. RightShoulder.MaxVelocity = 0.5
  726. RightShoulder.DesiredAngle = 0
  727. return
  728. end
  729.  
  730. if (toolAnim == "Lunge") then
  731. RightShoulder.MaxVelocity = 0.5
  732. LeftShoulder.MaxVelocity = 0.5
  733. RightHip.MaxVelocity = 0.5
  734. LeftHip.MaxVelocity = 0.5
  735. RightShoulder.DesiredAngle = 1.57
  736. LeftShoulder.DesiredAngle = 1.0
  737. RightHip.DesiredAngle = 1.57
  738. LeftHip.DesiredAngle = 1.0
  739. return
  740. end
  741. end
  742.  
  743. function move(time)
  744. local amplitude
  745. local frequency
  746.  
  747. if (pose == "Jumping") then
  748. moveJump()
  749. return
  750. end
  751.  
  752. if (pose == "FreeFall") then
  753. moveFreeFall()
  754. return
  755. end
  756.  
  757. if (pose == "Seated") then
  758. moveSit()
  759. return
  760. end
  761.  
  762. local climbFudge = 0
  763.  
  764. if (pose == "Running") then
  765. RightShoulder.MaxVelocity = 0.5
  766. LeftShoulder.MaxVelocity = 0.5
  767. amplitude = 1
  768. frequency = 9
  769. elseif (pose == "Climbing") then
  770. RightShoulder.MaxVelocity = 0.5
  771. LeftShoulder.MaxVelocity = 0.5
  772. amplitude = 1
  773. frequency = 9
  774. climbFudge = 3.14/2
  775. else
  776. amplitude = 0.1
  777. frequency = 1
  778. end
  779.  
  780. desiredAngle = amplitude * math.sin(time*frequency)
  781.  
  782. RightShoulder.DesiredAngle = -desiredAngle
  783. LeftShoulder.DesiredAngle = desiredAngle
  784. RightHip.DesiredAngle = desiredAngle
  785. LeftHip.DesiredAngle = -desiredAngle
  786.  
  787.  
  788. local tool = getTool()
  789.  
  790. if tool then
  791.  
  792. animStringValueObject = getToolAnim(tool)
  793.  
  794. if animStringValueObject then
  795. toolAnim = animStringValueObject.Value
  796. -- message recieved, delete StringValue
  797. animStringValueObject.Parent = nil
  798. toolAnimTime = time + .3
  799. end
  800.  
  801. if time > toolAnimTime then
  802. toolAnimTime = 0
  803. toolAnim = "None"
  804. end
  805.  
  806. animateTool()
  807.  
  808.  
  809. else
  810. toolAnim = "None"
  811. toolAnimTime = 0
  812. end
  813. end
  814.  
  815.  
  816. -- connect events
  817.  
  818. Humanoid.Died:connect(onDied)
  819. Humanoid.Running:connect(onRunning)
  820. Humanoid.Jumping:connect(onJumping)
  821. Humanoid.Climbing:connect(onClimbing)
  822. Humanoid.GettingUp:connect(onGettingUp)
  823. Humanoid.FreeFalling:connect(onFreeFall)
  824. Humanoid.FallingDown:connect(onFallingDown)
  825. Humanoid.Seated:connect(onSeated)
  826. Humanoid.PlatformStanding:connect(onPlatformStanding)
  827.  
  828. -- main program
  829.  
  830. local runService = game:service("RunService");
  831.  
  832. while Figure.Parent~=nil do
  833. local _, time = wait(0.1)
  834. move(time)
  835. end
Add Comment
Please, Sign In to add comment