Advertisement
zXzGamePROzXz

Fling gui

Mar 27th, 2019
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.20 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. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros, Edited by StarzoZero")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  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. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then
  95. return typeof(s[k])=="function"
  96. and function(_,...)return s[k](s,...)end or s[k]
  97. end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return rawget(self,s) or _rg:GetService(s)
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. RunService = FakeService({
  120. _btrs = {},
  121. RenderStepped = _rg:GetService("RunService").Heartbeat,
  122. BindToRenderStep = function(self,name,_,fun)
  123. self._btrs[name] = self.Heartbeat:Connect(fun)
  124. end,
  125. UnbindFromRenderStep = function(self,name)
  126. self._btrs[name]:Disconnect()
  127. end,
  128. },"RunService")
  129. }
  130. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  131. g.service = g.GetService
  132. FakeService(g,game)
  133. --Changing owner to fake player object to support owner:GetMouse()
  134. game,owner = g,g.Players.LocalPlayer
  135. end
  136. -- Made By JackMcJagger15
  137. local FlingKill = Instance.new("ScreenGui")
  138. local Main = Instance.new("Frame")
  139. local Label = Instance.new("Frame")
  140. local Shadow = Instance.new("Frame")
  141. local StartKill = Instance.new("TextButton")
  142. local StopKill = Instance.new("TextButton")
  143. local Instructions = Instance.new("TextLabel")
  144. local CurrentPower = Instance.new("TextLabel")
  145. local Recomendation = Instance.new("TextLabel")
  146. local NameOfGui = Instance.new("TextLabel")
  147. local Exit = Instance.new("TextButton")
  148. local UPArrow = Instance.new("TextButton")
  149. local DownArrow = Instance.new("TextButton")
  150.  
  151. -- Properties
  152.  
  153. FlingKill.Name = "Fling/Kill"
  154. FlingKill.Parent = game.CoreGui
  155.  
  156. Main.Name = "Main"
  157. Main.Parent = FlingKill
  158. Main.BackgroundColor3 = Color3.new(0.92549, 0.941177, 0.945098)
  159. Main.BorderSizePixel = 0
  160. Main.Position = UDim2.new(0.702554762, 0, 0.446640313, 0)
  161. Main.Size = UDim2.new(0, 217, 0, 233)
  162. Main.Selectable = true
  163. Main.Active = true
  164. Main.Draggable = true
  165.  
  166. Label.Name = "Label"
  167. Label.Parent = Main
  168. Label.BackgroundColor3 = Color3.new(0.741176, 0.764706, 0.780392)
  169. Label.BorderSizePixel = 0
  170. Label.Size = UDim2.new(0, 217, 0, 27)
  171.  
  172. Shadow.Name = "Shadow"
  173. Shadow.Parent = Main
  174. Shadow.BackgroundColor3 = Color3.new(0.67451, 0.694118, 0.705882)
  175. Shadow.BorderSizePixel = 0
  176. Shadow.Position = UDim2.new(0, 0, 0.115879826, 0)
  177. Shadow.Size = UDim2.new(0, 217, 0, 9)
  178.  
  179. StartKill.Name = "StartKill"
  180. StartKill.Parent = Main
  181. StartKill.BackgroundColor3 = Color3.new(0.741176, 0.764706, 0.780392)
  182. StartKill.BorderSizePixel = 0
  183. StartKill.Position = UDim2.new(0.195852548, 0, 0.227467805, 0)
  184. StartKill.Size = UDim2.new(0, 126, 0, 23)
  185. StartKill.Font = Enum.Font.Cartoon
  186. StartKill.Text = "FE Kill/Fling"
  187. StartKill.TextColor3 = Color3.new(0, 0, 0)
  188. StartKill.TextSize = 14
  189.  
  190. StopKill.Name = "StopKill"
  191. StopKill.Parent = Main
  192. StopKill.BackgroundColor3 = Color3.new(0.741176, 0.764706, 0.780392)
  193. StopKill.BorderSizePixel = 0
  194. StopKill.Position = UDim2.new(0.207373276, 0, 0.38197428, 0)
  195. StopKill.Size = UDim2.new(0, 124, 0, 23)
  196. StopKill.Font = Enum.Font.Cartoon
  197. StopKill.Text = "Stop FE Kill/Fling"
  198. StopKill.TextColor3 = Color3.new(0, 0, 0)
  199. StopKill.TextSize = 14
  200.  
  201. Instructions.Name = "Instructions"
  202. Instructions.Parent = Main
  203. Instructions.BackgroundColor3 = Color3.new(1, 1, 1)
  204. Instructions.BackgroundTransparency = 1
  205. Instructions.Position = UDim2.new(0.0391705073, 0, 0.549356222, 0)
  206. Instructions.Size = UDim2.new(0, 200, 0, 32)
  207. Instructions.Font = Enum.Font.Cartoon
  208. Instructions.Text = "Just touch someone to watch the fly to their death!"
  209. Instructions.TextColor3 = Color3.new(0, 0, 0)
  210. Instructions.TextSize = 14
  211. Instructions.TextWrapped = true
  212.  
  213. CurrentPower.Name = "CurrentPower"
  214. CurrentPower.Parent = Main
  215. CurrentPower.BackgroundColor3 = Color3.new(1, 1, 1)
  216. CurrentPower.BackgroundTransparency = 1
  217. CurrentPower.Position = UDim2.new(0.276497692, 0, 0.686695278, 0)
  218. CurrentPower.Size = UDim2.new(0, 98, 0, 36)
  219. CurrentPower.Font = Enum.Font.Cartoon
  220. CurrentPower.Text = "Current Power = 5"
  221. CurrentPower.TextColor3 = Color3.new(0, 0, 0)
  222. CurrentPower.TextSize = 14
  223.  
  224. Recomendation.Name = "Recomendation"
  225. Recomendation.Parent = Main
  226. Recomendation.BackgroundColor3 = Color3.new(1, 1, 1)
  227. Recomendation.BackgroundTransparency = 1
  228. Recomendation.Position = UDim2.new(0.0414746553, 0, 0.884120166, 0)
  229. Recomendation.Size = UDim2.new(0, 200, 0, 21)
  230. Recomendation.Font = Enum.Font.Cartoon
  231. Recomendation.Text = "Recommended Power is 5"
  232. Recomendation.TextColor3 = Color3.new(0, 0, 0)
  233. Recomendation.TextSize = 14
  234.  
  235. NameOfGui.Name = "NameOfGui"
  236. NameOfGui.Parent = Main
  237. NameOfGui.BackgroundColor3 = Color3.new(1, 1, 1)
  238. NameOfGui.BackgroundTransparency = 1
  239. NameOfGui.Position = UDim2.new(0.0806451589, 0, 0, 0)
  240. NameOfGui.Size = UDim2.new(0, 154, 0, 27)
  241. NameOfGui.Font = Enum.Font.Cartoon
  242. NameOfGui.Text = "FE Kill/Fling By JackMcJagger15"
  243. NameOfGui.TextColor3 = Color3.new(0, 0, 0)
  244. NameOfGui.TextSize = 14
  245.  
  246. Exit.Name = "Exit"
  247. Exit.Parent = Main
  248. Exit.BackgroundColor3 = Color3.new(1, 1, 1)
  249. Exit.BackgroundTransparency = 1
  250. Exit.Position = UDim2.new(0.907834113, 0, 0, 0)
  251. Exit.Size = UDim2.new(0, 20, 0, 27)
  252. Exit.Font = Enum.Font.Cartoon
  253. Exit.Text = "X"
  254. Exit.TextColor3 = Color3.new(0, 0, 0)
  255. Exit.TextSize = 14
  256.  
  257. UPArrow.Name = "UPArrow"
  258. UPArrow.Parent = Main
  259. UPArrow.BackgroundColor3 = Color3.new(1, 1, 1)
  260. UPArrow.BackgroundTransparency = 1
  261. UPArrow.Position = UDim2.new(0.0783410147, 0, 0.716738224, 0)
  262. UPArrow.Size = UDim2.new(0, 26, 0, 23)
  263. UPArrow.Font = Enum.Font.Cartoon
  264. UPArrow.Text = "Up"
  265. UPArrow.TextColor3 = Color3.new(0, 0, 0)
  266. UPArrow.TextSize = 12
  267. UPArrow.TextWrapped = true
  268.  
  269. DownArrow.Name = "DownArrow"
  270. DownArrow.Parent = Main
  271. DownArrow.BackgroundColor3 = Color3.new(1, 1, 1)
  272. DownArrow.BackgroundTransparency = 1
  273. DownArrow.Position = UDim2.new(0.792626739, 0, 0.714592278, 0)
  274. DownArrow.Size = UDim2.new(0, 26, 0, 23)
  275. DownArrow.Font = Enum.Font.Cartoon
  276. DownArrow.Text = "Down"
  277. DownArrow.TextColor3 = Color3.new(0, 0, 0)
  278. DownArrow.TextSize = 12
  279. DownArrow.TextWrapped = true
  280.  
  281. power = 500
  282. active = false
  283. local val = Instance.new("IntValue")
  284. val.Name = "Number"
  285. val.Parent = game.Players.LocalPlayer
  286. val.Value = 5
  287.  
  288. Exit.MouseButton1Click:connect(function()
  289. FlingKill.Enabled = false
  290. end)
  291.  
  292. StartKill.MouseButton1Click:connect(function()
  293. game:GetService('RunService').Stepped:connect(function()
  294. if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
  295. game.Players.LocalPlayer.Character.Head.CanCollide = false
  296. game.Players.LocalPlayer.Character.Torso.CanCollide = false
  297. game.Players.LocalPlayer.Character["Left Leg"].CanCollide = false
  298. game.Players.LocalPlayer.Character["Right Leg"].CanCollide = false
  299. else
  300. if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  301. game.Players.LocalPlayer.Character.Head.CanCollide = false
  302. game.Players.LocalPlayer.Character.UpperTorso.CanCollide = false
  303. game.Players.LocalPlayer.Character.LowerTorso.CanCollide = false
  304. game.Players.LocalPlayer.Character.HumanoidRootPart.CanCollide = false
  305. end
  306. end
  307. end)
  308. wait(.1)
  309. local bambam = Instance.new("BodyThrust")
  310. bambam.Parent = game.Players.LocalPlayer.Character.HumanoidRootPart
  311. bambam.Force = Vector3.new(power,0,power)
  312. bambam.Location = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  313. end)
  314.  
  315. StopKill.MouseButton1Click:connect(function()
  316. active = false
  317. game.Players.LocalPlayer.Character.HumanoidRootPart.BodyThrust:Remove()
  318. end)
  319.  
  320. UPArrow.MouseButton1Click:connect(function()
  321. power = power + 100
  322. game.Players.LocalPlayer.Number.Value = game.Players.LocalPlayer.Number.Value + 1
  323. CurrentPower.Text = "Current Power = " .. game.Players.LocalPlayer.Number.Value
  324. end)
  325.  
  326. DownArrow.MouseButton1Click:connect(function()
  327. power = power - 100
  328. game.Players.LocalPlayer.Number.Value = game.Players.LocalPlayer.Number.Value - 1
  329. CurrentPower.Text = "Current Power = " .. game.Players.LocalPlayer.Number.Value
  330. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement