Advertisement
HenloMyDude

the moon

Nov 16th, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.46 KB | None | 0 0
  1.  
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6.  
  7. function Smooth(part)
  8. part.TopSurface = "Smooth"
  9. part.BottomSurface = "Smooth"
  10. part.RightSurface = "Smooth"
  11. part.LeftSurface = "Smooth"
  12. end
  13.  
  14. plr = owner
  15. char = plr.Character
  16. ra = char["Right Arm"]
  17. la = char["Left Arm"]
  18. root = char.HumanoidRootPart
  19. hum = char.Humanoid
  20. dancin = false
  21.  
  22. clerp = function(toclerp, cf, number)
  23. local joint = toclerp
  24. joint.C0 = joint.C0:Lerp(cf, number)
  25. end
  26.  
  27. clerp2 = function(toclerp, cf)
  28. local joint = toclerp
  29. joint.C0 = cf
  30. end
  31.  
  32. clerp3 = function(toclerp, cf, number)
  33. local joint = toclerp
  34. joint.C1 = joint.C1:Lerp(cf, number)
  35. end
  36.  
  37. Swait,swait = function(number)
  38. if number == 0 or number == nil then
  39. game:GetService("RunService").Heartbeat:Wait()
  40. else
  41. for i = 1,number do
  42. game:GetService("RunService").Heartbeat:Wait()
  43. end
  44. end
  45. end
  46.  
  47. ezweld = function(p, a, b, cf)
  48. local weld = Instance.new("Weld",p)
  49. weld.Part0 = a
  50. weld.Part1 = b
  51. weld.C0 = cf
  52. return weld
  53. end
  54.  
  55. IT = Instance.new
  56. Rad = math.rad
  57. Cos = math.cos
  58. Sin = math.sin
  59. BrickC = BrickColor.new
  60. C3 = Color3.new
  61. VT = Vector3.new
  62.  
  63. anim = "Idle"
  64. attack = false
  65. local RS = char.Torso["Right Shoulder"]
  66. local LS = char.Torso["Left Shoulder"]
  67. local RH = char.Torso["Right Hip"]
  68. local LH = char.Torso["Left Hip"]
  69. local neck = char.Torso["Neck"]
  70. local anim = "Idle"
  71. local animate = char.Animate
  72. local root = char.HumanoidRootPart
  73. local rootj = root.RootJoint
  74. local timepos = 0
  75. local sine = 0
  76. local RSnor = RS.C0
  77. local LSnor = LS.C0
  78. local RHnor = RH.C0
  79. local LHnor = LH.C0
  80. local RSnor2 = RS.C1
  81. local LSnor2 = LS.C1
  82. local RHnor2 = RH.C1
  83. local LHnor2 = LH.C1
  84. local rootjnor = rootj.C0
  85. local necknor = neck.C0
  86. local tors = char.Torso
  87. local playstealanim = false
  88. hold = false
  89. surfing = false
  90. mouse = plr:GetMouse()
  91. hold = false
  92. Debris = game:GetService("Debris")
  93.  
  94. --------------
  95.  
  96. moon = Instance.new("Part",char)
  97. moon.CanCollide = false
  98. moon.BrickColor = BrickColor.new("Light blue")
  99. moon.Size = Vector3.new(1, 5.5, 5.5)
  100. moon.Position = root.Position
  101. mesh = Instance.new("SpecialMesh",moon)
  102. mesh.MeshId = "rbxassetid://744297195"
  103. mesh.Scale = Vector3.new(0.125, 0.125, 0.125)
  104. moonw = ezweld(char, moon, root, CFrame.new(0, -12, 0) * CFrame.Angles(0, Rad(90), 0))
  105. moonnor = moonw.C0
  106.  
  107. --------------
  108.  
  109. local Value = Instance.new("NumberValue",script)
  110. Value.Name = "Damage"
  111. Value.Value = 1500
  112.  
  113. function Fling(part,damage)
  114. local BodyThrust = Instance.new("BodyThrust",part)
  115. BodyThrust.Force = Vector3.new(0,2 * (Value.Value * (damage / 5)),1 * (Value.Value * (damage / 5)))
  116. delay(0.05,function()
  117. if BodyThrust then
  118. BodyThrust:Destroy()
  119. end
  120. end)
  121. end
  122.  
  123. maintheme = Instance.new("Sound",moon)
  124. maintheme.SoundId = "rbxassetid://2762786055"
  125. maintheme.Volume = 7
  126. maintheme.Looped = true
  127. maintheme:Play()
  128.  
  129. function Animate(INOUT)
  130. if INOUT == "In" then
  131. animate.Parent = char
  132. elseif INOUT == "Out" then
  133. for _,v in next, hum:GetPlayingAnimationTracks() do
  134. v:Stop();
  135. end
  136. animate.Parent = nil
  137. end
  138. end
  139.  
  140. function smasheffect(cf)
  141. local s = Instance.new("Sound",moon) s.SoundId = "rbxassetid://743521450" s.Volume = 7 s.Pitch = 1.2 s:Play()
  142. local part = Instance.new("Part",char)
  143. part.BrickColor = moon.BrickColor
  144. part.CanCollide = false
  145. part.Anchored = true
  146. part.CFrame = cf
  147. local mesh = Instance.new("SpecialMesh",part)
  148. mesh.MeshId = "rbxassetid://489415447"
  149. mesh.Scale = Vector3.new(3, 3, 3)
  150. coroutine.resume(coroutine.create(function()
  151. for i = 1,20 do
  152. Swait()
  153. part.Transparency = part.Transparency + 0.1
  154. part.CFrame = cf
  155. part.Size = Vector3.new(0.1, 0.1, 0.1)
  156. mesh.Scale = mesh.Scale + Vector3.new(1, 1, 1)
  157. end
  158. part:Destroy()
  159. end))
  160. end
  161.  
  162. function Oof(Ch)
  163. if Ch.ClassName == "Model" and Ch ~= char then
  164. local D = Ch:GetDescendants()
  165. for i = 1,#D do
  166. local ee = D[i]
  167. if ee:IsA("Humanoid") then
  168. ee.BreakJointsOnDeath = false
  169. elseif ee:IsA("Motor6D") or ee:IsA("Motor") then
  170. local Old = ee.Parent
  171. ee.Parent = nil
  172. local R = Instance.new("Glue",Old)
  173. R.Name = ee.Name
  174. R.Part0 = ee.Part0
  175. R.Part1 = ee.Part1
  176. R.C0 = ee.C0
  177. R.C1 = ee.C1
  178. end
  179. end
  180. end
  181. end
  182.  
  183. function Dismember(MAN,DOWHAT)
  184. local HUM = MAN:FindFirstChildOfClass("Humanoid")
  185. if HUM then
  186. HUM.Health = 0
  187. HUM.PlatformStand = true
  188. end
  189. Oof(MAN)
  190. end
  191.  
  192. function blocky(poot)
  193. Instance.new("SpecialMesh",poot).MeshType = "Brick"
  194. end
  195.  
  196. function Died(Character)
  197. local owned = Instance.new("NumberValue",Character)
  198. owned.Name = "owned"
  199. local Sound = Instance.new("Sound",Character:WaitForChild("Head"))
  200. Sound.SoundId = "rbxassetid://877221802"
  201. Sound.EmitterSize = 100
  202. Sound.MaxDistance = 100000
  203. if Sound then
  204. Sound:Play()
  205. end
  206. Value.Value = 1500
  207. local D = Character:GetDescendants()
  208. local dud = Character
  209. local Torso = dud:FindFirstChild("Torso") or dud:FindFirstChild("UpperTorso")
  210. local Humanoid = dud:FindFirstChildOfClass("Humanoid")
  211. Humanoid.MaxHealth = 200
  212. for i = 1,#D do
  213. if D[i]:IsA("BasePart") and D[i]:FindFirstAncestorWhichIsA("Tool") == nil then
  214. D[i].Anchored = true
  215. D[i].Transparency = 1
  216. if D[i] == Humanoid.RootPart then
  217. local Attachment = Instance.new("Attachment",Humanoid.RootPart)
  218. Attachment.Rotation = -Humanoid.RootPart.Rotation
  219. local ParticleEmitter = Instance.new("ParticleEmitter",Attachment)
  220. ParticleEmitter.Enabled = false
  221. ParticleEmitter.Texture = "rbxasset://textures/particles/fire_main.dds"
  222. ParticleEmitter.LightEmission = 0.8
  223. ParticleEmitter.Color = ColorSequence.new(Torso.Color)
  224. ParticleEmitter.Size = NumberSequence.new(5,25)
  225. ParticleEmitter.Transparency = NumberSequence.new(0,1)
  226. ParticleEmitter.Lifetime = NumberRange.new(1.5)
  227. ParticleEmitter.Rate = 500
  228. ParticleEmitter.Rotation = NumberRange.new(-360,360)
  229. ParticleEmitter.Speed = NumberRange.new(0,0)
  230. ParticleEmitter.EmissionDirection = Enum.NormalId.Top
  231. ParticleEmitter:Emit(15)
  232. end
  233. end
  234. end
  235. end
  236.  
  237. function slam()
  238. attack = true
  239. Animate("Out")
  240. local touchy = moon.Touched:connect(function(hit)
  241. smashed = false
  242. local dud = hit.Parent
  243. if not dud:FindFirstChild("smacked") then
  244. local s = Instance.new("Sound",moon) s.SoundId = "rbxassetid://0" s.Volume = 5 s:Play() Debris:AddItem(s, 1)
  245. local smacked = Instance.new("NumberValue",dud)
  246. smacked.Name = "smacked"
  247. Debris:AddItem(smacked, 0.65)
  248. local Torso = dud:FindFirstChild("Torso") or dud:FindFirstChild("UpperTorso")
  249. local Humanoid = dud:FindFirstChildOfClass("Humanoid")
  250. if Torso then
  251. Fling(Torso, 15)
  252. end
  253. if Humanoid then
  254. Humanoid.Health = Humanoid.Health - 15
  255. if Value.Value > 500 then
  256. Humanoid.Sit = true
  257. end
  258. end
  259. coroutine.resume(coroutine.create(function()
  260. for i = 1,1000000000000000000000 do
  261. wait()
  262. if Humanoid.RootPart ~= nil and (Humanoid.RootPart.Position.X > 500 or Humanoid.RootPart.Position.X < -500) and not dud:FindFirstChild("owned") then
  263. smashed = true
  264. Value.Value = 1500
  265. dud:BreakJoints()
  266. Died(dud)
  267. local Attachment = Instance.new("Attachment",Humanoid.RootPart)
  268. Humanoid.RootPart.Rotation = Vector3.new(0,0,0)
  269. local ParticleEmitter = Instance.new("ParticleEmitter",Attachment)
  270. ParticleEmitter.Enabled = false
  271. ParticleEmitter.Texture = "rbxasset://textures/particles/fire_main.dds"
  272. ParticleEmitter.LightEmission = 0.8
  273. ParticleEmitter.Color = ColorSequence.new(Torso.Color)
  274. ParticleEmitter.Size = NumberSequence.new(15,0)
  275. ParticleEmitter.Transparency = NumberSequence.new(0,0.5)
  276. ParticleEmitter.Lifetime = NumberRange.new(1.5)
  277. ParticleEmitter.Rate = 500
  278. ParticleEmitter.Rotation = NumberRange.new(-360,360)
  279. ParticleEmitter.Speed = NumberRange.new(-500,500)
  280. ParticleEmitter.EmissionDirection = Enum.NormalId.Left
  281. ParticleEmitter:Emit(100)
  282. end
  283. end
  284. end))
  285. end
  286. end)
  287. for i = 1,18 do
  288. Swait()
  289. clerp(moonw, moonnor * CFrame.new(0 + 0.15 * Cos(sine / 36), 0 + 0.3 * Cos(sine / 18), 0), 0.2)
  290. clerp(RS, RSnor * CFrame.Angles(0, 0, Rad(180)), 0.2)
  291. clerp(LS, LSnor, 0.2)
  292. clerp(RH, RHnor, 0.2)
  293. clerp(LH, LHnor, 0.2)
  294. clerp(neck, necknor * CFrame.Angles(Rad(-15), 0, 0), 0.2)
  295. clerp(rootj, rootjnor, 0.2)
  296. end
  297. for i = 1,11 do
  298. Swait()
  299. clerp(moonw, moonnor * CFrame.new(0, 3, 3) * CFrame.Angles(Rad(90), 0, 0), 0.3)
  300. clerp(RS, RSnor * CFrame.Angles(0, 0, Rad(90)), 0.2)
  301. clerp(LS, LSnor, 0.2)
  302. clerp(RH, RHnor, 0.2)
  303. clerp(LH, LHnor, 0.2)
  304. clerp(neck, necknor * CFrame.Angles(Rad(15), 0, 0), 0.2)
  305. clerp(rootj, rootjnor, 0.2)
  306. end
  307. smasheffect(CFrame.new(moon.CFrame.x, moon.CFrame.y, moon.CFrame.z))
  308. touchy:Disconnect()
  309. Animate("In")
  310. attack = false
  311. end
  312.  
  313. function sit()
  314. attack = true
  315. Animate("Out")
  316. for i = 1,150 do
  317. Swait()
  318. clerp(moonw, moonnor * CFrame.new(0 + 0.15 * Cos(sine / 36), 0 + 0.3 * Cos(sine / 18), 0), 0.2)
  319. clerp(RS, RSnor * CFrame.Angles(0, 0, Rad(-25)), 0.2)
  320. clerp(LS, LSnor * CFrame.Angles(0, 0, Rad(25)), 0.2)
  321. clerp(RH, RHnor * CFrame.Angles(Rad(-5), Rad(-10), Rad(75)), 0.2)
  322. clerp(LH, LHnor * CFrame.Angles(Rad(-5), Rad(10), Rad(-75)), 0.2)
  323. clerp(neck, necknor * CFrame.Angles(Rad(15), 0, 0), 0.2)
  324. clerp(rootj, rootjnor * CFrame.new(0, 0, 18.5) * CFrame.Angles(Rad(-15), 0, 0), 0.2)
  325. end
  326. Animate("In")
  327. attack = false
  328. end
  329.  
  330. function wave()
  331. attack = true
  332. Animate("Out")
  333. for i = 1,150 do
  334. Swait()
  335. clerp(moonw, moonnor * CFrame.new(0 + 0.15 * Cos(sine / 36), 0 + 0.3 * Cos(sine / 18), 0), 0.2)
  336. clerp(RS, RSnor * CFrame.Angles(0, 0, 0), 0.2)
  337. clerp(LS, LSnor * CFrame.Angles(0, 0, 0), 0.2)
  338. clerp(RH, RHnor * CFrame.Angles(0, 0, 0), 0.2)
  339. clerp(LH, LHnor * CFrame.Angles(0, 0, 0), 0.2)
  340. clerp(neck, necknor * CFrame.Angles(0, 0, 0), 0.2)
  341. clerp(rootj, rootjnor * CFrame.new(0, 0, 0.25) * CFrame.Angles(Rad(-15), 0, 0), 0.2)
  342. end
  343. Animate("In")
  344. attack = false
  345. end
  346.  
  347. function surf()
  348. if surfing then
  349. surfing = false
  350. root.Anchored = false
  351. else
  352. surfing = true
  353. end
  354. end
  355.  
  356. spin = 0
  357.  
  358. mouse.Button1Down:connect(function()
  359. if attack == false then
  360. slam()
  361. end
  362. end)
  363.  
  364. mouse.KeyDown:connect(function(key)
  365. key=key:lower()
  366. if key == "t" and attack == false then
  367. sit()
  368. end
  369. if key == "u" and attack == false then
  370. surf()
  371. end
  372. end)
  373.  
  374. while true do
  375. Swait()
  376. sine = sine + 1
  377. spin = spin + 1
  378. if surfing then
  379. root.Anchored = true
  380. char:TranslateBy(hum.MoveDirection)
  381. clerp(moonw, moonnor * CFrame.new(0, 3, 0) * CFrame.Angles(Rad(90), 0, 0), 0.3)
  382. clerp(RS, RSnor, 0.15)
  383. clerp(LS, LSnor, 0.15)
  384. clerp(RH, RHnor, 0.15)
  385. clerp(LH, LHnor, 0.15)
  386. clerp(neck, necknor, 0.15)
  387. clerp(rootj, rootjnor * CFrame.new(0, 0, 3), 0.15)
  388. end
  389. local TORSOVELOCITY = (root.Velocity * VT(1, 0, 1)).magnitude
  390. if TORSOVELOCITY < 1 then
  391. anim = "Idle"
  392. if math.random(1,60) == 1 then
  393. smasheffect(root.CFrame * CFrame.new(0, -2, 0) * CFrame.Angles(0, Rad(spin), 0))
  394. end
  395. if attack == false then
  396. clerp(moonw, moonnor * CFrame.new(0 + 0.15 * Cos(sine / 36), 0 + 0.3 * Cos(sine / 18), 0), 0.05)
  397. clerp(RS, RSnor, 0.15)
  398. clerp(LS, LSnor, 0.15)
  399. clerp(RH, RHnor, 0.15)
  400. clerp(LH, LHnor, 0.15)
  401. clerp(neck, necknor, 0.15)
  402. clerp(rootj, rootjnor, 0.15)
  403. end
  404. else
  405. anim = "Walk"
  406. if attack == false then
  407. clerp(moonw, moonnor * CFrame.new(0 + 0.15 * Cos(sine / 36), 0 + 0.3 * Cos(sine / 18), -5), 0.05)
  408. clerp(RS, RSnor, 0.15)
  409. clerp(LS, LSnor, 0.15)
  410. clerp(RH, RHnor, 0.15)
  411. clerp(LH, LHnor, 0.15)
  412. clerp(neck, necknor, 0.15)
  413. clerp(rootj, rootjnor, 0.15)
  414. end
  415. end
  416. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement