Advertisement
lafur

Untitled

Feb 14th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.08 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  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 print("FE Compatibility code V2 by Mokiros")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 --Made by LordRevorius the 420mememaster
  6. lmaohat = Instance.new("Accessory")
  7. lmaohat.Name = "Sheik"
  8. lmaohat.AttachmentForward = Vector3.new(0, 0.148, -0.989)
  9. lmaohat.AttachmentPos = Vector3.new(0, 0.35, 0.07)
  10. lmaohat.AttachmentRight = Vector3.new(1, 0, 0)
  11. lmaohat.AttachmentUp = Vector3.new(0, 0.989, 0.148)
  12.  
  13. lmaohandle = Instance.new("Part")
  14. lmaohandle.Parent = lmaohat
  15. lmaohandle.Name = "Handle"
  16. lmaohandle.Size = Vector3.new(2, 1.2, 2)
  17.  
  18. lmaoatta = Instance.new("Attachment")
  19. lmaoatta.Name = "HatAttachment"
  20. lmaoatta.Parent = lmaohandle
  21. lmaoatta.Axis = Vector3.new(1, -0, -0)
  22. lmaoatta.SecondaryAxis = Vector3.new(0, 0.989, 0.148)
  23. lmaoatta.Position = Vector3.new(0, 0.449, 0.085)
  24. lmaoatta.Rotation = Vector3.new(8.511, 0, -0)
  25.  
  26. lmaomesh = Instance.new("SpecialMesh")
  27. lmaomesh.Parent = lmaohandle
  28. lmaomesh.MeshId = "http://www.roblox.com/asset/?id=12305010"
  29. lmaomesh.TextureId = "http://www.roblox.com/asset/?id=167764345"
  30. lmaomesh.Scale = Vector3.new(1, 1, 1)
  31.  
  32.  
  33. local Player = game:GetService("Players").LocalPlayer
  34. local Backpack = Player:WaitForChild("Backpack")
  35. local Character = Player.Character
  36.  
  37. if not Character:FindFirstChild("Shirt") then
  38. NewShirt = Instance.new("Shirt", Character)
  39. NewShirt.Name = "Shirt"
  40. end
  41.  
  42.  
  43. if not Character:FindFirstChild("Pants") then
  44. NewPants = Instance.new("Pants", Character)
  45. NewPants.Name = "Pants"
  46. end
  47.  
  48.  
  49. for _, v in pairs(Character:GetChildren()) do
  50. if v:IsA("Accessory") then
  51. v:Destroy()
  52. end
  53. end
  54.  
  55. for _, v in pairs(Character:GetChildren()) do
  56. if v:IsA("CharacterMesh") then
  57. v:Destroy()
  58. end
  59. end
  60.  
  61. for _, v in pairs(Character:GetChildren()) do
  62. if v:IsA("ShirtGraphic") then
  63. v:Destroy()
  64. end
  65. end
  66.  
  67. lmaohat.Parent = Character
  68. Character["Shirt"].ShirtTemplate = "http://www.roblox.com/asset/?id=590311692"
  69. Character["Pants"].PantsTemplate = "http://www.roblox.com/asset/?id=686633812"
  70.  
  71. local Torso = Character:WaitForChild("Torso")
  72. local Left_Arm = Character:WaitForChild("Left Arm")
  73. local Right_Arm = Character:WaitForChild("Right Arm")
  74.  
  75. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  76. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  77.  
  78. local RA_Weld = Instance.new("Weld")
  79. local LA_Weld = Instance.new("Weld")
  80.  
  81. local Tool = Instance.new("Tool",Backpack)
  82. local Handle = Instance.new("Part", Tool)
  83. local Mesh = Instance.new("SpecialMesh", Handle)
  84. Mesh.Scale = Vector3.new(.9,.9,.9)
  85.  
  86. Tool.Name = "I got a rock"
  87. Handle.Name = "Handle"
  88.  
  89. Mesh.MeshType = "FileMesh"
  90. Mesh.MeshId = "http://www.roblox.com/asset/?id=1290033"
  91. Mesh.TextureId = "http://www.roblox.com/asset/?id=1290030"
  92.  
  93. function AngleOfReach(distance, altitude, velocity)
  94. local theta = math.atan((velocity^2 + math.sqrt(velocity^4 -196.2*(196.2*distance^2 + 2*altitude*velocity^2)))/(196.2*distance))
  95. if theta ~= theta then
  96. theta = math.pi/4
  97. end
  98. return(theta)
  99. end
  100.  
  101. local thr = false
  102.  
  103. Tool.Equipped:connect(function(Mouse)
  104. RightShoulder.Parent = nil
  105. LeftShoulder.Parent = nil
  106. LA_Weld.Parent = Torso
  107. RA_Weld.Parent = Torso
  108. LA_Weld.Part0 = Torso
  109. LA_Weld.Part1 = Left_Arm
  110. RA_Weld.Part0 = Torso
  111. RA_Weld.Part1 = Right_Arm
  112. RA_Weld.C0 = CFrame.new(1.5, 0, 0)
  113. LA_Weld.C0 = CFrame.new(-1.5, 0, 0)
  114.  
  115. local StartRA = RA_Weld.C0
  116. local StartLA = LA_Weld.C0
  117. for Index = .1, 1, .1 do
  118. RA_Weld.C0 = StartRA:lerp(CFrame.new(1, 1.25, 0) * CFrame.Angles(math.rad(220), 0, math.rad(-40)), Index)
  119. LA_Weld.C0 = StartLA:lerp(CFrame.new(-1, 1.25, 0) * CFrame.Angles(math.rad(220), 0, math.rad(40)), Index)
  120. wait()
  121. end
  122. StartRA = RA_Weld.C0
  123. StartLA = LA_Weld.C0
  124. Mouse.Button1Down:connect(function()
  125. if thr then return end
  126. thr = true
  127. for Index = .1, 1, .2 do
  128. RA_Weld.C0 = StartRA:lerp(CFrame.new(.75, 1.25, 0) * CFrame.Angles(math.rad(160), 0, math.rad(-40)), Index)
  129. LA_Weld.C0 = StartLA:lerp(CFrame.new(-.75, 1.25, 0) * CFrame.Angles(math.rad(160), 0, math.rad(40)), Index)
  130. wait()
  131. end
  132. Handle.Transparency = 1
  133. StartRA = RA_Weld.C0
  134. StartLA = LA_Weld.C0
  135. local Velocity = 100
  136. local mousePosition = Mouse.Hit
  137. local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z) -- remove Y from the equation, it's not needed
  138. local mousePos = Vector3.new(mousePosition.X, 0, mousePosition.Z) -- ditto
  139. local distance = (handlePos - mousePos).magnitude -- Get the distance between the handle and the mouse
  140. local altitude = mousePosition.Y - Tool.Handle.Position.Y
  141. local angle = AngleOfReach(distance, altitude, Velocity) -- Calculate the angle
  142. local stone = Tool.Handle:Clone()
  143. stone.Parent = workspace
  144. stone.Transparency = 0
  145. stone.CanCollide = false
  146. stone.CFrame = Tool.Handle.CFrame
  147. stone.Velocity = (CFrame.new(stone.Position, Vector3.new(mousePosition.X, stone.Position.Y, mousePosition.Z)) * CFrame.Angles(angle, 0, 0)).lookVector * Velocity -- Throwing 'n stuff, it probably didn't need to be this long
  148. wait(.07)
  149. stone.CanCollide = true
  150. wait()
  151. local HitConnection
  152. local Hit = false
  153. HitConnection = stone.Touched:connect(function(Part)
  154. if Hit then return end
  155. if not Part:IsDescendantOf(Character) then
  156. Hit = true
  157. local HitCharacter
  158. if Part.Parent:IsA("Accessory") or Part.Parent:IsA("Tool") then
  159. HitCharacter = Part.Parent.Parent
  160. else
  161. HitCharacter = Part.Parent
  162. end
  163. local HitHumanoid = HitCharacter:FindFirstChild("Humanoid")
  164. if HitHumanoid then
  165. HitHumanoid:TakeDamage(35)
  166. hitmarker = Instance.new("Sound")
  167. hitmarker.Parent = HitCharacter.Head
  168. hitmarker.SoundId = "rbxassetid://131864673"
  169. hitmarker.Volume = 10
  170. hitmarker:Play()
  171. wait(1)
  172. hitmarker:Destroy()
  173. end
  174. HitConnection:disconnect()
  175. end
  176. end)
  177. for Index = .1, 1, .2 do
  178. RA_Weld.C0 = StartRA:lerp(CFrame.new(1, 1.25, 0) * CFrame.Angles(math.rad(220), 0, math.rad(-40)), Index)
  179. LA_Weld.C0 = StartLA:lerp(CFrame.new(-1, 1.25, 0) * CFrame.Angles(math.rad(220), 0, math.rad(40)), Index)
  180. wait()
  181. end
  182. StartRA = RA_Weld.C0
  183. StartLA = LA_Weld.C0
  184. wait(.5)
  185. thr = false
  186. Handle.Transparency = 0
  187. end)
  188.  
  189. Mouse.Button2Down:connect(function()
  190. if thr then return end
  191. thr = true
  192. for Index = .1, 1, .2 do
  193. RA_Weld.C0 = StartRA:lerp(CFrame.new(.75, 1.25, -1.3) * CFrame.Angles(math.rad(110), 0, math.rad(-40)), Index)
  194. LA_Weld.C0 = StartLA:lerp(CFrame.new(-.75, 1.25, -1.3) * CFrame.Angles(math.rad(110), 0, math.rad(40)), Index)
  195. wait()
  196. end
  197.  
  198. local stone = Handle:clone()
  199. stone.Parent = Handle
  200. local w = Instance.new("Weld",stone)
  201. w.Part0 = stone
  202. w.Part1 = Handle
  203. local Hit = false
  204. HitConnection = stone.Touched:connect(function(Part)
  205. if Hit then return end
  206. if not Part:IsDescendantOf(Character) then
  207. Hit = true
  208. local HitCharacter
  209. if Part.Parent:IsA("Accessory") or Part.Parent:IsA("Tool") then
  210. HitCharacter = Part.Parent.Parent
  211. else
  212. HitCharacter = Part.Parent
  213. end
  214. local HitHumanoid = HitCharacter:FindFirstChild("Humanoid")
  215. if HitHumanoid then
  216. HitHumanoid:TakeDamage(35)
  217. hitmarker = Instance.new("Sound")
  218. hitmarker.Parent = HitCharacter.Head
  219. hitmarker.SoundId = "rbxassetid://131864673"
  220. hitmarker.Volume = 10
  221. hitmarker:Play()
  222. wait(1)
  223. hitmarker:Destroy()
  224. end
  225. end
  226. end)
  227.  
  228. StartRA = RA_Weld.C0
  229. StartLA = LA_Weld.C0
  230.  
  231. wait()
  232.  
  233. stone:Destroy()
  234. HitConnection:disconnect()
  235.  
  236. for Index = .1, 1, .2 do
  237. RA_Weld.C0 = StartRA:lerp(CFrame.new(1, 1.25, 0) * CFrame.Angles(math.rad(220), 0, math.rad(-40)), Index)
  238. LA_Weld.C0 = StartLA:lerp(CFrame.new(-1, 1.25, 0) * CFrame.Angles(math.rad(220), 0, math.rad(40)), Index)
  239. wait()
  240. end
  241.  
  242. StartRA = RA_Weld.C0
  243. StartLA = LA_Weld.C0
  244.  
  245. wait(.5)
  246. thr = false
  247. end)
  248. end)
  249.  
  250. Tool.Unequipped:connect(function(Mouse)
  251. LA_Weld.Parent = nil
  252. RA_Weld.Parent = nil
  253. RightShoulder.Parent = Torso
  254. LeftShoulder.Parent = Torso
  255. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement