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