Advertisement
HenloMyDude

lolhem

Dec 30th, 2019
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.55 KB | None | 0 0
  1. print("FE code by Starzozero, Thanks to him!")
  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,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code by Mokiros, Edited by StarzoZero")
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then
  96. return typeof(s[k])=="function"
  97. and function(_,...)return s[k](s,...)end or s[k]
  98. end
  99. end,
  100. __newindex = function(self,k,v)
  101. local s = rawget(self,"_RealService")
  102. if s then s[k]=v end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return rawget(self,s) or _rg:GetService(s)
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. RunService = FakeService({
  121. _btrs = {},
  122. RenderStepped = _rg:GetService("RunService").Heartbeat,
  123. BindToRenderStep = function(self,name,_,fun)
  124. self._btrs[name] = self.Heartbeat:Connect(fun)
  125. end,
  126. UnbindFromRenderStep = function(self,name)
  127. self._btrs[name]:Disconnect()
  128. end,
  129. },"RunService")
  130. }
  131. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  132. g.service = g.GetService
  133. FakeService(g,game)
  134. --Changing owner to fake player object to support owner:GetMouse()
  135. game,owner = g,g.Players.LocalPlayer
  136. end
  137.  
  138. m = Instance.new("Sound",owner.Character.Head)
  139. m.SoundId = "rbxassetid://614032233"
  140. m.Looped = true
  141. m.Volume = 5
  142. m2 = Instance.new("Sound",owner.Character["Right Leg"])
  143. m2.SoundId = "rbxassetid://614032233"
  144. m2.Looped = true
  145. m2.Volume = 5
  146. m3 = Instance.new("Sound",owner.Character["Left Leg"])
  147. m3.SoundId = "rbxassetid://614032233"
  148. m3.Looped = true
  149. m3.Volume = 5
  150. m4 = Instance.new("Sound",owner.Character["Right Arm"])
  151. m4.SoundId = "rbxassetid://614032233"
  152. m4.Looped = true
  153. m4.Volume = 5
  154. m5 = Instance.new("Sound",owner.Character["Left Arm"])
  155. m5.SoundId = "rbxassetid://614032233"
  156. m5.Looped = true
  157. m5.Volume = 5
  158. m6 = Instance.new("Sound",owner.Character.Torso)
  159. m6.SoundId = "rbxassetid://614032233"
  160. m6.Looped = true
  161. m6.Volume = 5
  162. m:Play()
  163. billboard = Instance.new("BillboardGui", owner.Character.Head)
  164. billboard.Adornee = owner.Character.Head
  165. billboard.StudsOffset = Vector3.new(-6, 4, 0)
  166. billboard.Size = UDim2.new(4,0,2,0)
  167. text = Instance.new("TextBox", billboard)
  168. text.Text = ""
  169. text.TextStrokeColor3 = Color3.fromRGB(0,0,0)
  170. text.TextColor3 = Color3.fromRGB(255,0,0)
  171. text.BackgroundTransparency = 1
  172. text.TextScaled = true
  173. text.TextStrokeTransparency = 0
  174. text.Size = billboard.Size
  175. text.Font = "Arcade"
  176. wait(0)
  177. print("M")
  178. text.Text = "M"
  179. wait(0)
  180. print("A")
  181. text.Text = "MA"
  182. wait(0)
  183. print("Y")
  184. text.Text = "MAY"
  185. wait(0)
  186. print("H")
  187. text.Text = "MAYH"
  188. wait(0)
  189. print("E")
  190. text.Text = "MAYHE"
  191. wait(0)
  192. print("M")
  193. text.Text = "MAYHEM"
  194. wait(0)
  195. mayhem = true
  196. local rightarm = Instance.new("Weld", owner.Character.Torso)
  197. rightarm.Part0 = owner.Character.Torso
  198. rightarm.Part1 = owner.Character["Right Arm"]
  199. rightarm.C0 = CFrame.new(1.5,0,0)
  200. rightarm.Name = "RightArmWeld"
  201. local rightleg = Instance.new("Weld", owner.Character.Torso)
  202. rightleg.Part0 = owner.Character.Torso
  203. rightleg.Part1 = owner.Character["Right Leg"]
  204. rightleg.C0 = CFrame.new(0.5,-2,0)
  205. rightleg.Name = "RightLegWeld"
  206. local leftarm = Instance.new("Weld", owner.Character.Torso)
  207. leftarm.Part0 = owner.Character.Torso
  208. leftarm.Part1 = owner.Character["Left Arm"]
  209. leftarm.C0 = CFrame.new(-1.5,0,0)
  210. leftarm.Name = "LeftArmWeld"
  211. local leftleg = Instance.new("Weld", owner.Character.Torso)
  212. leftleg.Part0 = owner.Character.Torso
  213. leftleg.Part1 = owner.Character["Left Leg"]
  214. leftleg.C0 = CFrame.new(-0.5,-2,0)
  215. leftleg.Name = "LeftLegWeld"
  216. local head = Instance.new("Weld", owner.Character.Torso)
  217. head.Part0 = owner.Character.Torso
  218. head.Part1 = owner.Character.Head
  219. head.C0 = CFrame.new(0,1.5,0)
  220. head.Name = "HeadWeld"
  221. local humanoidrootpart = Instance.new("Weld", owner.Character.HumanoidRootPart)
  222. humanoidrootpart.Part0 = owner.Character.HumanoidRootPart
  223. humanoidrootpart.Part1 = owner.Character.Torso
  224. humanoidrootpart.Name = "HumanoidRootPartWeld"
  225. rootpart = owner.Character.HumanoidRootPart
  226. sine = 0
  227. cananimate = true
  228.  
  229. if cananimate then
  230. sine = sine + 1
  231. end
  232. while true do
  233. wait()
  234. if cananimate then
  235. sine = sine + 1
  236. end
  237. humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(math.sin(sine/2)/3,0,0) * CFrame.Angles(0,0,math.sin(sine/2)/4+rootpart.RotVelocity.y/50),0.6)
  238. head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.6)
  239. leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.rad(90)+math.cos(sine/1)/1.5,math.rad(20)+math.sin(sine/2)/1.5,-math.sin(sine/2)) * CFrame.new(0,-1+math.sin(sine/2)/2,0),0.6)
  240. rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(90)+math.cos(sine/1)/1.5,math.rad(-20)-math.sin(sine/2)/1.5,math.sin(sine/2)) * CFrame.new(0,-1+math.sin(sine/2)/2,0),0.6)
  241. leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(0,0,-math.sin(sine/2)/3) * CFrame.new(0,-1,0),0.6)
  242. rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.Angles(0,0,-math.sin(sine/2)/3) * CFrame.new(0,-1,0),0.6)
  243. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement