DrakerMaker

God of the Worlds

Aug 31st, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.19 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. do
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83. Plr = owner
  84. Char = Plr.Character
  85. Create = Instance.new
  86. local shadowhead = Create("Part",Char.Head)
  87. shadowhead.BrickColor = BrickColor.new("Really black")
  88. shadowhead.Size = Vector3.new(1.2, 0.6, 1)
  89. shadowhead.CanCollide = false
  90. local shadowheadmesh = Create("SpecialMesh",shadowhead)
  91. shadowheadmesh.MeshType = "Head"
  92. shadowheadmesh.Scale = Vector3.new(1.26, 1.5, 1.26)
  93. local weld2 = Create("Weld",shadowhead)
  94. weld2.Part0 = shadowhead
  95. weld2.Part1 = Char.Head
  96. weld2.C1 = CFrame.new(0, 0.200000048, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  97. Char.Head:FindFirstChildOfClass("Decal").Texture = "http://www.roblox.com/asset/?id=753559068"
  98. local Song = Create("Sound",Char.Head)
  99. Song.SoundId = "rbxassetid://492070484"
  100. Song.Volume = 2
  101. Song.Looped = true
  102. Song:Play()
  103. function wbtwe(Part0, Part1, C0)
  104. local weld = Instance.new("Weld", Part0)
  105. weld.Part0 = Part0
  106. weld.Part1 = Part1
  107. weld.C0 = Part1.CFrame:inverse() *Part1.CFrame *C0
  108. return weld
  109. end
  110. idle = 3.7
  111. walk = 1
  112. tilt = 1
  113. animateing = false
  114. deb = false
  115. hrw = wbtwe(owner.Character.Torso, owner.Character.HumanoidRootPart, CFrame.new(0, 0, 0))
  116. law = wbtwe(owner.Character["Left Arm"], owner.Character.Torso, CFrame.new(0.4, 0, 0.8) *CFrame.Angles(0, 25, math.sin(-3.7) *3))
  117. raw = wbtwe(owner.Character["Right Arm"], owner.Character.Torso, CFrame.new(-0.4, 0, 1.2) *CFrame.Angles(0, 0, math.sin(3.7) *3))
  118. llw = wbtwe(owner.Character["Left Leg"], owner.Character.HumanoidRootPart, CFrame.new(0.45, 2.1, 0) *CFrame.Angles(0, 25, 0))
  119. rlw = wbtwe(owner.Character["Right Leg"], owner.Character.HumanoidRootPart, CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(0, 0, 0))
  120. hw = wbtwe(owner.Character.Head, owner.Character.Torso, CFrame.new(0, -1.45, 0) *CFrame.Angles(0, 0, 0))
  121. light = Create("Part", owner.Character)
  122. light.BrickColor = BrickColor.new("Institutional white")
  123. light.Material = "Neon"
  124. light.Shape = "Ball"
  125. light.Size = Vector3.new(7, 7, 7)
  126. light.CanCollide = false
  127. light.Anchored = true
  128. light.CFrame = owner.Character.HumanoidRootPart.CFrame *CFrame.new(4, 4, 5)
  129. attacktaunt = Create("Sound", owner.Character.Head)
  130. attacktaunt.Volume = 4
  131. attacktaunt.SoundId = "rbxassetid://1718412034"
  132. stomp = Create("Sound", owner.Character["Left Leg"])
  133. stomp.SoundId = "rbxassetid://168514932"
  134. stomp.Volume = 2
  135. an = coroutine.wrap(function()
  136. while wait() do
  137. if Char.HumanoidRootPart.Velocity.Magnitude < 1 then
  138. for i = 0,1,0.1 do
  139. if animateing == false then
  140. idle = idle +0.1
  141. game:GetService("RunService").Stepped:wait()
  142. hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, math.sin(idle) *0.3, 0), 0.1)
  143. law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.4, 0, 0.8) *CFrame.Angles(0, 25, math.sin(-3.7) *3), 0.1)
  144. raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.4, 0, 1.2) *CFrame.Angles(0, 0, math.sin(3.7) *3), 0.1)
  145. llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, 0) *CFrame.Angles(0, 25, 0), 0.1)
  146. rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(0, 0, 0), 0.1)
  147. hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.45, 0) *CFrame.Angles(0, 0, 0), 0.1)
  148. end
  149. end
  150. end
  151. if Char.HumanoidRootPart.Velocity.Magnitude > 1 then
  152. for i = 0,1,0.1 do
  153. if animateing == false then
  154. walk = walk +0.1
  155. tilt = tilt +0.09
  156. game:GetService("RunService").Stepped:wait()
  157. law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.45, 0, 0) *CFrame.Angles(math.sin(walk) *1, 25, 0), 0.1)
  158. raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.4, 0, 0) *CFrame.Angles(math.sin(-walk) *1, 0, 0), 0.1)
  159. llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, 0) *CFrame.Angles(math.sin(-walk) *1, 25, 0), 0.1)
  160. rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(math.sin(walk) *1, 0, 0), 0.1)
  161. hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, 0, 0) *CFrame.Angles(0, math.sin(tilt) *0.3, 0), 0.6)
  162. end
  163. end
  164. end
  165. end
  166. end)
  167. an()
  168. lightfollow = coroutine.wrap(function()
  169. while game:GetService("RunService").Stepped:wait() do
  170. for i = 0,1,0.1 do
  171. game:GetService("RunService").Stepped:wait()
  172. light.CFrame = light.CFrame:lerp(owner.Character.HumanoidRootPart.CFrame *CFrame.new(4, 4, 5), 0.1)
  173. end
  174. end
  175. end)
  176. lightfollow()
  177. mouse.KeyDown:connect(function(k)
  178. if k == "e" then
  179. if deb == false then
  180. if mouse.Target then
  181. deb = true
  182. attacktaunt:Play()
  183. animateing = true
  184. Char.Humanoid.WalkSpeed = 6
  185. for i = 0,1,0.06 do
  186. game:GetService("RunService").Stepped:wait()
  187. hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, 0, 0) *CFrame.Angles(0, 0, 0), 0.6)
  188. hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.4, 0.6) *CFrame.Angles(-0.6, 0, 0), 0.1)
  189. 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.06), 0.1)
  190. raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.4, 0.3, 0) *CFrame.Angles(0, 25, -0.06), 0.1)
  191. llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 1.7, 0.2) *CFrame.Angles(0, 25, 0), 0.1)
  192. rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(0, 0, 0), 0.1)
  193. end
  194. stomp:Play()
  195. for i = 0,1,0.06 do
  196. game:GetService("RunService").Stepped:wait()
  197. hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.4, -0.6) *CFrame.Angles(0.6, 0, 0), 0.1)
  198. llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, 1) *CFrame.Angles(0, 25, 0), 0.1)
  199. end
  200. local attack = Instance.new("Part", workspace)
  201. attack.Anchored = true
  202. attack.Shape = "Ball"
  203. attack.BrickColor = BrickColor.new("Institutional white")
  204. attack.Size = Vector3.new(5, 5, 5)
  205. attack.CanCollide = false
  206. attack.Position = mouse.Hit.p +Vector3.new(0, 10, 0)
  207. attack.Material = "Neon"
  208. attack.CastShadow = false
  209. attack.Touched:connect(function(p)
  210. if p.Parent:FindFirstChildOfClass("Humanoid") then
  211. if p.Parent.Name ~= Plr.Name then
  212. p.Parent:BreakJoints()
  213. end
  214. end
  215. end)
  216. Char.Humanoid.WalkSpeed = 16
  217. animateing = false
  218. deb = false
  219. for i = 1,50 do
  220. game:GetService("RunService").Stepped:wait()
  221. attack.Size = attack.Size +Vector3.new(1, 1, 1)
  222. attack.Transparency = attack.Transparency +0.04
  223. end
  224. attack:Destroy()
  225. end
  226. end
  227. end
  228. if k == "t" then
  229. if deb == false then
  230. deb = true
  231. for i = 1,20 do
  232. game:GetService("RunService").Stepped:wait()
  233. light.Transparency = light.Transparency +0.05
  234. light.Size = light.Size +Vector3.new(1, 1, 1)
  235. end
  236. owner.Character:MoveTo(mouse.Hit.p)
  237. for i = 1,20 do
  238. game:GetService("RunService").Stepped:wait()
  239. light.Transparency = light.Transparency -0.05
  240. light.Size = light.Size -Vector3.new(1, 1, 1)
  241. end
  242. deb = false
  243. end
  244. end
  245. end)
Add Comment
Please, Sign In to add comment