DrakrMakr

God of Physics

Aug 25th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.31 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2.  
  3. local Player,game,owner = owner,game
  4.  
  5. local RealPlayer = Player
  6.  
  7. do local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  8. plr = game:GetService("Players").LocalPlayer
  9. function wbtwe(Part0, Part1, C0)
  10. local weld = Instance.new("Weld", Part0)
  11. weld.Part0 = Part0
  12. weld.Part1 = Part1
  13. weld.C0 = Part1.CFrame:inverse() *Part1.CFrame *C0
  14. return weld
  15. end
  16. Create = Instance.new
  17. mouse = plr:GetMouse()
  18. char = plr.Character
  19. char.Humanoid.Name = "GodOfPhysics"
  20. char.GodOfPhysics.Animator.Parent = nil
  21. char.GodOfPhysics.WalkSpeed = 25
  22. char.GodOfPhysics.JumpPower = 60
  23. hrw = wbtwe(owner.Character.Torso, owner.Character.HumanoidRootPart, CFrame.new(0, math.sin(7) *3 -6, 0))
  24. song = Create("Sound", owner.Character.HumanoidRootPart)
  25. song.SoundId = "rbxassetid://2435339444"
  26. song.Volume = 3
  27. song.Looped = true
  28. song:Play()
  29. law = wbtwe(owner.Character["Left Arm"], owner.Character.Torso, CFrame.new(1.45, 0.3, 0.1) *CFrame.Angles(0, 25, 0.3))
  30. raw = wbtwe(owner.Character["Right Arm"], owner.Character.Torso, CFrame.new(-1.4, 0.3, 0) *CFrame.Angles(0, 0, -0.3))
  31. llw = wbtwe(owner.Character["Left Leg"], owner.Character.Torso, CFrame.new(0.45, 2.1, 0.7) *CFrame.Angles(0, 25, 0))
  32. rlw = wbtwe(owner.Character["Right Leg"], owner.Character.Torso, CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(0, 0, 0))
  33. hw = wbtwe(owner.Character.Head, owner.Character.Torso, CFrame.new(0, -1.4, -0.6) *CFrame.Angles(0.6, 0, 0))
  34. local txt = Instance.new("BillboardGui", char)
  35. txt.Adornee = char .Head
  36. txt.Name = "_status"
  37. txt.Size = UDim2.new(2, 0, 0.5, 0)
  38. txt.StudsOffset = Vector3.new(-9, 4, 0)
  39. local text = Instance.new("TextLabel", txt)
  40. text.Size = UDim2.new(10, 0, 7, 0)
  41. text.FontSize = "Size24"
  42. text.TextScaled = true
  43. text.TextTransparency = 0
  44. text.BackgroundTransparency = 1
  45. text.TextTransparency = 0
  46. text.TextStrokeTransparency = 0
  47. text.Font = "Highway"
  48. text.TextStrokeColor3 = BrickColor.new("Dark orange").Color
  49. text.TextColor3 = BrickColor.new("Deep orange").Color
  50. text.Text = "God of Physics"
  51. local cha = Instance.new("BillboardGui", char)
  52. cha.Adornee = char .Head
  53. cha.Name = "_chat"
  54. cha.Size = UDim2.new(2, 0, 0.5, 0)
  55. cha.StudsOffset = Vector3.new(-9, 8, 0)
  56. local chat = Instance.new("TextLabel", cha)
  57. chat.Size = UDim2.new(10, 0, 7, 0)
  58. chat.FontSize = "Size24"
  59. chat.TextScaled = true
  60. chat.TextTransparency = 0
  61. chat.BackgroundTransparency = 1
  62. chat.TextTransparency = 0
  63. chat.TextStrokeTransparency = 0
  64. chat.Font = "Highway"
  65. chat.TextStrokeColor3 = BrickColor.new("Dark orange").Color
  66. chat.TextColor3 = BrickColor.new("Deep orange").Color
  67. chat.Text = ""
  68. text.TextTransparency = 0.5
  69. function swait(num)
  70. if num == nil then
  71. game:GetService("RunService").Stepped:wait()
  72. end
  73. if num ~= nil then
  74. game:GetService("RunService").Stepped:wait(num)
  75. end
  76. end
  77. arms = 0.3
  78. anim = coroutine.wrap(function()
  79. while true do
  80. swait()
  81. if owner.Character.HumanoidRootPart.Velocity.Magnitude < 1 and owner.Character.HumanoidRootPart.Velocity.y < 1 then
  82.  
  83. end
  84. end
  85. end)
  86. anim()
  87. float = 7
  88. floatanim = coroutine.wrap(function()
  89. while true do
  90. swait()
  91. for i = 0,1,0.1 do
  92. float = float +0.06
  93. wait()
  94. hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, math.sin(float) *2 -6, 0), 0.1)
  95. end
  96. swait()
  97. for i = 0,1,0.1 do
  98. wait()
  99. float = float +0.06
  100. hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, math.sin(float) *2 -6, 0), 0.1)
  101. end
  102. end
  103. end)
  104. floatanim()
  105. owner.Chatted:connect(function(msg)
  106. if string.sub(msg, 1, 2) ~= "/e" then
  107. for i = 1,string.len(msg) +1 do
  108. swait()
  109. chat.Text = string.sub(msg, 1, i)
  110. end
  111. wait(3)
  112. chat.Text = ""
  113. end
  114. end)
  115. shrink = false
  116. mouse.KeyDown:connect(function(key)
  117. if key == "e" then
  118. for i = 0,1,0.1 do
  119. swait()
  120. law.C0 = law.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(1.45, 2.2, 0.05) *CFrame.Angles(0, 25, 2), 0.03)
  121. end
  122. local a = Instance.new("Part", workspace)
  123. a.BrickColor = BrickColor.new("Bright orange")
  124. a.Material = "Neon"
  125. a.Shape = "Ball"
  126. a.Size = Vector3.new(15, 15 ,15)
  127. a.CanCollide = false
  128. a.Anchored = true
  129. a.CFrame = mouse.Hit *CFrame.new(0, -15, 0)
  130. a.Transparency = 0
  131. a.CastShadow = false
  132. for i = 0,1,0.1 do
  133. swait()
  134. a.CFrame = a.CFrame:lerp(mouse.Hit *CFrame.new(0, 205, 0), 0.01)
  135. end
  136. for i = 0,1,0.1 do
  137. swait()
  138. law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.45, 0.3, 0.1) *CFrame.Angles(0, 25, 0.3), 0.1)
  139. end
  140. a.Touched:connect(function(p)
  141. if p.Parent:FindFirstChild("GodOfPhysics") == nil then
  142. if p.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  143. p.Parent:FindFirstChildOfClass("Humanoid").Parent = nil
  144. for i,v in pairs(p.Parent:GetChildren()) do
  145. if v:IsA("Accessory") then
  146. v.Parent = nil
  147. end
  148. if v:IsA("CharacterMesh") then
  149. v.Parent = nil
  150. end
  151. if v:IsA("Script") then
  152. v.Parent = nil
  153. end
  154. if v:IsA("Part") then
  155. v.Material = "Neon"
  156. v.BrickColor = BrickColor.new("White")
  157. v.Transparency = 0.7
  158. v.Anchored = false
  159. end
  160. if v:IsA("MeshPart") then
  161. v.Material = "Neon"
  162. v.BrickColor = BrickColor.new("White")
  163. v.Transparency = 0.7
  164. v.Anchored = false
  165. end
  166. end
  167. if p.Parent:FindFirstChild("Head") ~= nil then for i,v in pairs(p.Parent.Head:GetChildren()) do v.Parent = nil end end
  168. end
  169. end
  170. end)
  171. for i = 1,109 do
  172. wait()
  173. a.Size = a.Size +Vector3.new(2, 2, 2)
  174. a.Transparency = a.Transparency +.01
  175. end
  176. a:Destroy()
  177. end
  178. end)
Add Comment
Please, Sign In to add comment