Advertisement
geovanycool

Untitled

Oct 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.67 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.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,Connect=function(self,f)self.Function=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()}
  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 and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87.  
  88. --liek a boss with coke
  89. local plr = owner
  90. local char = plr.Character
  91. local torso = char:findFirstChild("Torso")
  92. local head = char.Head
  93. local ra = char:findFirstChild("Right Arm")
  94. local la = char:findFirstChild("Left Arm")
  95. local rl = char:findFirstChild("Right Leg")
  96. local ll = char:findFirstChild("Left Leg")
  97. local rs = torso:findFirstChild("Right Shoulder")
  98. local ls = torso:findFirstChild("Left Shoulder")
  99.  
  100. local debounce = false
  101.  
  102. function part(parent, size, formfactor, color, collide, transparency)
  103. local p=Instance.new("Part", parent)
  104. p.FormFactor=formfactor
  105. p.CanCollide=false
  106. p.Size=size
  107. p.Locked=true
  108. p.Transparency=transparency
  109. p.Position=torso.Position
  110. p.BrickColor=color
  111. p.FrontSurface="SmoothNoOutlines"
  112. p.BackSurface="SmoothNoOutlines"
  113. p.LeftSurface="SmoothNoOutlines"
  114. p.BottomSurface="SmoothNoOutlines"
  115. p.TopSurface="SmoothNoOutlines"
  116. p.RightSurface="SmoothNoOutlines"
  117. return p
  118. end
  119. function weld(c0, c1, part1, part0)
  120. local wel=Instance.new("Weld", main)
  121. wel.Part0 = part0
  122. wel.Part1 = part1
  123. wel.C0 = c0
  124. wel.C1 = c1
  125. return wel
  126. end
  127. function specialmesh(parent, meshType, scale, meshId, texture)
  128. local mesh = Instance.new("SpecialMesh", parent)
  129. mesh.Scale = scale
  130. mesh.MeshType = meshType
  131. mesh.MeshId = meshId
  132. mesh.TextureId = texture
  133. return mesh
  134. end
  135.  
  136. tool = Instance.new("Tool", plr.Backpack)
  137. tool.Name = "Coke"
  138. tool.GripForward = Vector3.new(-0.976, 0, -0.217)
  139. tool.GripPos = Vector3.new(0.03, 0, 0)
  140. tool.GripRight = Vector3.new(0.217, 0, -0.976)
  141. tool.GripUp = Vector3.new(0, 1, 0)
  142.  
  143. local p = part(tool, Vector3.new(1, 1.2, 1), "Custom", BrickColor.new("Mid gray"), false, 0)
  144. p.Name = "Handle"
  145. local m = specialmesh(p, "FileMesh", Vector3.new(1.2, 1.2, 1.2), "http://www.roblox.com/asset/?id=10470609", "http://www.roblox.com/asset/?id=10470600")
  146.  
  147.  
  148. tool.Equipped:connect(function(mouse)
  149. ar = Instance.new("Part", char)
  150. ar.FormFactor = "Custom"
  151. ar.Size = Vector3.new(1, 1, 1)
  152. ar.Transparency = 1
  153. ar.CanCollide = false
  154. ar.Locked = true
  155. ar:breakJoints()
  156.  
  157.  
  158. local fakel = Instance.new("Weld", char)
  159. fakel.Part0 = char.Torso
  160. fakel.Part1 = ar
  161. fakel.C0 = CFrame.new(1.5, 0.45, 0)
  162. welditbro = Instance.new("Weld", char)
  163. welditbro.C0 = CFrame.new(0, 0.45, 0)
  164. welditbro.Part0 = ra
  165. welditbro.Part1 = ar
  166.  
  167. for i = 0, 90, 30 do
  168. fakel.C0 = CFrame.new(1.5, 0.45, 0) * CFrame.Angles(math.rad(i), 0, 0)
  169. wait()
  170. end
  171.  
  172. mouse.Button1Down:connect(function(mouse)
  173. if debounce then return end
  174. debounce = true
  175. for i = 90, 120, 10 do
  176. fakel.C0 = CFrame.new(1.5, 0.45, 0) * CFrame.Angles(math.rad(i/2), math.rad(i), math.rad(i/2))
  177. wait()
  178. end
  179. wait(1)
  180. for i = 120, 90, -10 do
  181. fakel.C0 = CFrame.new(1.5, 0.45, 0) * CFrame.Angles(math.rad(i/2), math.rad(i), math.rad(i/2))
  182. wait()
  183. end
  184. fakel.C0 = CFrame.new(1.5, 0.45, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
  185. local flood = part(workspace, workspace:findFirstChild("Base").Size, "Custom", BrickColor.new("Brown"), false, 0)
  186. flood.Anchored = true
  187. flood.Touched:connect(function(hit)
  188. if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent.Name ~= char.Name then
  189. hit.Parent:BreakJoints()
  190. end
  191. end)
  192. flood.CFrame = workspace:FindFirstChild("Base").CFrame * CFrame.new(0, -2, 0)
  193. for _ = 0, 6, 0.1 do
  194. flood.CFrame = flood.CFrame * CFrame.new(0, 0.1, 0)
  195. wait()
  196. end
  197. flood:Destroy()
  198.  
  199. debounce = false
  200. end)
  201.  
  202.  
  203. end)
  204.  
  205. tool.Unequipped:connect(function(mouse)
  206. pcall(function()
  207. ar:Destroy()
  208. fakel:Destroy()
  209. welditbro:Destroy()
  210. end)
  211. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement