Advertisement
Godzillagamerzz10

Idiot Script (FE) (Created by me)

Jun 25th, 2019
1,427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.88 KB | None | 0 0
  1. ---- Idiot Script
  2. -- Created by: GODZILLAGAMERZ13.
  3. --(THIS IS MY 1ST SCRIPT THAT'S NOT AN EDIT, A GUI, OR A CONVERTED SCRIPT!)
  4.  
  5. --https://github.com/Mokiros/roblox-FE-compatibility
  6.  
  7. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  8.  
  9. local Player,game,owner = owner,game
  10.  
  11. local RealPlayer = Player
  12.  
  13. do
  14.  
  15. print("FE Compatibility code V2 by Mokiros")
  16.  
  17. local RealPlayer = RealPlayer
  18.  
  19. script.Parent = RealPlayer.Character
  20.  
  21.  
  22.  
  23. --Fake event to make stuff like Mouse.KeyDown work
  24.  
  25. local Disconnect_Function = function(this)
  26.  
  27. this[1].Functions[this[2]] = nil
  28.  
  29. end
  30.  
  31. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  32.  
  33. local FakeEvent_Metatable = {__index={
  34.  
  35. Connect = function(this,f)
  36.  
  37. local i = tostring(math.random(0,10000))
  38.  
  39. while this.Functions[i] do
  40.  
  41. i = tostring(math.random(0,10000))
  42.  
  43. end
  44.  
  45. this.Functions[i] = f
  46.  
  47. return setmetatable({this,i},Disconnect_Metatable)
  48.  
  49. end
  50.  
  51. }}
  52.  
  53. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  54.  
  55. local function fakeEvent()
  56.  
  57. return setmetatable({Functions={}},FakeEvent_Metatable)
  58.  
  59. end
  60.  
  61.  
  62.  
  63. --Creating fake input objects with fake variables
  64.  
  65. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  66.  
  67. FakeMouse.keyUp = FakeMouse.KeyUp
  68.  
  69. FakeMouse.keyDown = FakeMouse.KeyDown
  70.  
  71. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  72.  
  73. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  74.  
  75. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  76.  
  77. end}
  78.  
  79. --Merged 2 functions into one by checking amount of arguments
  80.  
  81. CAS.UnbindAction = CAS.BindAction
  82.  
  83.  
  84.  
  85. --This function will trigger the events that have been :Connect()'ed
  86.  
  87. local function TriggerEvent(self,ev,...)
  88.  
  89. for _,f in pairs(self[ev].Functions) do
  90.  
  91. f(...)
  92.  
  93. end
  94.  
  95. end
  96.  
  97. FakeMouse.TriggerEvent = TriggerEvent
  98.  
  99. UIS.TriggerEvent = TriggerEvent
  100.  
  101.  
  102.  
  103. --Client communication
  104.  
  105. local Event = Instance.new("RemoteEvent")
  106.  
  107. Event.Name = "UserInput_Event"
  108.  
  109. Event.OnServerEvent:Connect(function(plr,io)
  110.  
  111. if plr~=RealPlayer then return end
  112.  
  113. FakeMouse.Target = io.Target
  114.  
  115. FakeMouse.Hit = io.Hit
  116.  
  117. if not io.isMouse then
  118.  
  119. local b = io.UserInputState == Enum.UserInputState.Begin
  120.  
  121. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  122.  
  123. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  124.  
  125. end
  126.  
  127. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  128.  
  129. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  130.  
  131. end
  132.  
  133. for _,t in pairs(CAS.Actions) do
  134.  
  135. for _,k in pairs(t.Keys) do
  136.  
  137. if k==io.KeyCode then
  138.  
  139. t.Function(t.Name,io.UserInputState,io)
  140.  
  141. end
  142.  
  143. end
  144.  
  145. end
  146.  
  147. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  148.  
  149. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  150.  
  151. end
  152.  
  153. end)
  154.  
  155. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  156.  
  157. local Mouse = owner:GetMouse()
  158.  
  159. local UIS = game:GetService("UserInputService")
  160.  
  161. local input = function(io,RobloxHandled)
  162.  
  163. if RobloxHandled then return end
  164.  
  165. --Since InputObject is a client-side instance, we create and pass table instead
  166.  
  167. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  168.  
  169. end
  170.  
  171. UIS.InputBegan:Connect(input)
  172.  
  173. UIS.InputEnded:Connect(input)
  174.  
  175.  
  176.  
  177. local h,t
  178.  
  179. --Give the server mouse data every second frame, but only if the values changed
  180.  
  181. --If player is not moving their mouse, client won't fire events
  182.  
  183. local HB = game:GetService("RunService").Heartbeat
  184.  
  185. while true do
  186.  
  187. if h~=Mouse.Hit or t~=Mouse.Target then
  188.  
  189. h,t=Mouse.Hit,Mouse.Target
  190.  
  191. Event:FireServer({isMouse=true,Target=t,Hit=h})
  192.  
  193. end
  194.  
  195. --Wait 2 frames
  196.  
  197. for i=1,2 do
  198.  
  199. HB:Wait()
  200.  
  201. end
  202.  
  203. end]==],script)
  204.  
  205.  
  206.  
  207. ----Sandboxed game object that allows the usage of client-side methods and services
  208.  
  209. --Real game object
  210.  
  211. local RealGame = game
  212.  
  213.  
  214.  
  215. --Metatable for fake service
  216.  
  217. local FakeService_Metatable = {
  218.  
  219. __index = function(self,k)
  220.  
  221. local s = rawget(self,"_RealService")
  222.  
  223. if s then
  224.  
  225. return typeof(s[k])=="function"
  226.  
  227. and function(_,...)return s[k](s,...)end or s[k]
  228.  
  229. end
  230.  
  231. end,
  232.  
  233. __newindex = function(self,k,v)
  234.  
  235. local s = rawget(self,"_RealService")
  236.  
  237. if s then s[k]=v end
  238.  
  239. end
  240.  
  241. }
  242.  
  243. local function FakeService(t,RealService)
  244.  
  245. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  246.  
  247. return setmetatable(t,FakeService_Metatable)
  248.  
  249. end
  250.  
  251.  
  252.  
  253. --Fake game object
  254.  
  255. local FakeGame = {
  256.  
  257. GetService = function(self,s)
  258.  
  259. return rawget(self,s) or RealGame:GetService(s)
  260.  
  261. end,
  262.  
  263. Players = FakeService({
  264.  
  265. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  266.  
  267. },"Players"),
  268.  
  269. UserInputService = FakeService(UIS,"UserInputService"),
  270.  
  271. ContextActionService = FakeService(CAS,"ContextActionService"),
  272.  
  273. RunService = FakeService({
  274.  
  275. _btrs = {},
  276.  
  277. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  278.  
  279. BindToRenderStep = function(self,name,_,fun)
  280.  
  281. self._btrs[name] = self.Heartbeat:Connect(fun)
  282.  
  283. end,
  284.  
  285. UnbindFromRenderStep = function(self,name)
  286.  
  287. self._btrs[name]:Disconnect()
  288.  
  289. end,
  290.  
  291. },"RunService")
  292.  
  293. }
  294.  
  295. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  296.  
  297. FakeGame.service = FakeGame.GetService
  298.  
  299. FakeService(FakeGame,game)
  300.  
  301. --Changing owner to fake player object to support owner:GetMouse()
  302.  
  303. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  304.  
  305. end
  306.  
  307.  
  308. local mouse = Player:GetMouse()
  309. local char = game.Players.LocalPlayer.Character
  310. local surface =Instance.new("BillboardGui",char.Head)
  311. local text = Instance.new("TextLabel",surface)
  312. surface.Size = 0, 200,6, 50
  313. text.TextSize = 100
  314. text.Text = "Idiot"
  315. text.BackroundTransparency = 1
  316. text.TextColor3 = 0, 68, 255
  317. --Sound stuff
  318. local snd = Instance.new("Sound",char.Torso)
  319. snd.Looped = true
  320. snd.Name = "Music"
  321. snd.SoundId = 2703155053
  322. -------------------------------------
  323. for i,v in pairs(char:GetChildren()) do
  324. if v:IsA"Accessory" or v:IsA"Shirt" or v:IsA"Pants" then
  325. v:Destroy()
  326. elseif v:IsA"Part"then
  327. v.BrickColor = BrickColor:Random()
  328. end
  329. end
  330. ------------------------------------
  331. char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=144076357"
  332. char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=144076759"
  333. ------------------------------------
  334. mouse.KeyDown:connect(function(Press)
  335. Press=Press:lower()
  336. if Press=='t' then
  337. snd.SoundId = 594594778 -- Let it go parody
  338. end
  339. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement