Advertisement
zephpsian

Untitled

Feb 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 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. local rem = Instance.new("RemoteEvent", game.ReplicatedStorage)
  88.  
  89. -- Farewell Infortality.
  90. -- Version: 2.82
  91. -- Instances:
  92. local ScreenGui = Instance.new("ScreenGui")
  93. local Executor = Instance.new("Frame")
  94. local Frame = Instance.new("Frame")
  95. local TextBox = Instance.new("TextBox")
  96. local exe = Instance.new("TextButton")
  97. local cle = Instance.new("TextButton")
  98. local pri = Instance.new("TextLabel")
  99. local TextLabel = Instance.new("TextLabel")
  100. local bar = Instance.new("Frame")
  101. --Properties:
  102. ScreenGui.Parent = owner:WaitForChild("PlayerGui")
  103.  
  104. Executor.Name = "Executor"
  105. Executor.Parent = ScreenGui
  106. Executor.Active = true
  107. Executor.BackgroundColor3 = Color3.new(0.313726, 0.313726, 0.313726)
  108. Executor.BorderSizePixel = 0
  109. Executor.Position = UDim2.new(0.554826558, 0, 0.299810231, 0)
  110. Executor.Selectable = true
  111. Executor.Size = UDim2.new(0, 419, 0, 277)
  112.  
  113. Frame.Parent = Executor
  114. Frame.BackgroundColor3 = Color3.new(0.415686, 0.415686, 0.415686)
  115. Frame.BorderSizePixel = 0
  116. Frame.Size = UDim2.new(0, 419, 0, 21)
  117.  
  118. TextBox.Parent = Frame
  119. TextBox.BackgroundColor3 = Color3.new(0.227451, 0.227451, 0.227451)
  120. TextBox.BorderSizePixel = 0
  121. TextBox.Position = UDim2.new(0.0190930795, 0, 2.9523809, 0)
  122. TextBox.Size = UDim2.new(0, 402, 0, 207)
  123. TextBox.ZIndex = 3
  124. TextBox.Font = Enum.Font.GothamSemibold
  125. TextBox.MultiLine = true
  126. TextBox.Text = ""
  127. TextBox.TextColor3 = Color3.new(0.792157, 0.792157, 0.792157)
  128. TextBox.TextSize = 14
  129. TextBox.TextXAlignment = Enum.TextXAlignment.Left
  130. TextBox.TextYAlignment = Enum.TextYAlignment.Top
  131.  
  132. exe.Name = "exe"
  133. exe.Parent = Frame
  134. exe.BackgroundColor3 = Color3.new(0.313726, 0.313726, 0.313726)
  135. exe.BorderColor3 = Color3.new(0.792157, 0.792157, 0.792157)
  136. exe.Position = UDim2.new(0.035799522, 0, 1.33333337, 0)
  137. exe.Size = UDim2.new(0, 95, 0, 27)
  138. exe.Font = Enum.Font.GothamSemibold
  139. exe.Text = "Execute"
  140. exe.TextColor3 = Color3.new(0.792157, 0.792157, 0.792157)
  141. exe.TextSize = 14
  142.  
  143. cle.Name = "cle"
  144. cle.Parent = Frame
  145. cle.BackgroundColor3 = Color3.new(0.313726, 0.313726, 0.313726)
  146. cle.BorderColor3 = Color3.new(0.792157, 0.792157, 0.792157)
  147. cle.Position = UDim2.new(0.307875901, 0, 1.33333337, 0)
  148. cle.Size = UDim2.new(0, 62, 0, 27)
  149. cle.Font = Enum.Font.GothamSemibold
  150. cle.Text = "Clear"
  151. cle.TextColor3 = Color3.new(0.792157, 0.792157, 0.792157)
  152. cle.TextSize = 14
  153.  
  154. pri.Name = "pri"
  155. pri.Parent = Frame
  156. pri.BackgroundColor3 = Color3.new(1, 1, 1)
  157. pri.BackgroundTransparency = 1
  158. pri.Size = UDim2.new(0, 36, 0, 21)
  159. pri.Font = Enum.Font.GothamBold
  160. pri.Text = "Pri"
  161. pri.TextColor3 = Color3.new(1, 1, 1)
  162. pri.TextSize = 20
  163.  
  164. TextLabel.Parent = Frame
  165. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  166. TextLabel.BackgroundTransparency = 1
  167. TextLabel.Position = UDim2.new(0.0692124069, 0, -0.428571433, 0)
  168. TextLabel.Size = UDim2.new(0, 35, 0, 39)
  169. TextLabel.Font = Enum.Font.GothamBold
  170. TextLabel.Text = "sm"
  171. TextLabel.TextColor3 = Color3.new(0.627451, 1, 0.988235)
  172. TextLabel.TextSize = 20
  173. TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  174.  
  175. bar.Name = "bar"
  176. bar.Parent = Frame
  177. bar.BackgroundColor3 = Color3.new(0.556863, 0.890196, 0.878431)
  178. bar.BorderSizePixel = 0
  179. bar.Position = UDim2.new(-0.00238663494, 0, 0.958913147, 0)
  180. bar.Size = UDim2.new(0, 420, 0, 2)
  181. -- Scripts:
  182.  
  183. cle.MouseButton1Click:connect(function()
  184. TextBox.Text = ""
  185. end)
  186.  
  187.  
  188. local a = Instance.new('LocalScript')
  189. a.Parent = exe
  190. event = game.ReplicatedStorage.RemoteEvent
  191.  
  192. a.Parent.MouseButton1Click:Connect(function()
  193. event:FireServer(TextBox.Text)
  194. end)
  195.  
  196.  
  197.  
  198. Executor.Draggable = true
  199. Executor.Active = true
  200. Executor.Selectable = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement