SHOW:
|
|
- or go back to the newest paste.
1 | if game.PlaceId == 1224212277 then | |
2 | local Check = function(a, b) | |
3 | for _, v in next, a do | |
4 | if v == b then return true end | |
5 | end | |
6 | return false | |
7 | end | |
8 | ||
9 | local meta, oldmeta = getrawmetatable(game), {} | |
10 | if setreadonly then | |
11 | setreadonly(meta, false) | |
12 | elseif is_protosmasher_caller then | |
13 | make_writeable(meta) | |
14 | end | |
15 | for i, v in next, meta do oldmeta[i] = v end | |
16 | local realmethods = {} | |
17 | realmethods.Fire = Instance.new("BindableEvent").Fire | |
18 | realmethods.Invoke = Instance.new("BindableFunction").Invoke | |
19 | realmethods.FireServer = Instance.new("RemoteEvent").FireServer | |
20 | realmethods.InvokeServer = Instance.new("RemoteFunction").InvokeServer | |
21 | ||
22 | meta.__namecall = function(...) | |
23 | local args = {...} | |
24 | local t, k = args[1], args[#args] | |
25 | local actions = {}; | |
26 | for i, v in pairs(args) do | |
27 | if i ~= 1 and i ~= #args then table.insert(actions, v) end | |
28 | end | |
29 | if k == "Fire" or k == "Invoke" or k == "FireServer" or k == "InvokeServer" then | |
30 | local returns = {realmethods[k](t, unpack(actions))} | |
31 | if t.Name == "RemoteFunction" and actions[1] == "DataFetch" then | |
32 | local data = game.HttpService:JSONDecode(returns[1]) | |
33 | for _, v in next, game.ReplicatedStorage.ItemDatabase.Vehicles:GetDescendants() do | |
34 | if v.Name ~= "Data" and not Check(data.Data.Items, v.Name) then | |
35 | table.insert(data.Data.Items, v.Name) | |
36 | end | |
37 | end | |
38 | returns[1] = game.HttpService:JSONEncode(data) | |
39 | elseif t.Name == "RemoteFunction" and actions[1] == "GetVehicles" then | |
40 | local vehicles = {} | |
41 | for _, v in next, game.ReplicatedStorage.ItemDatabase.Vehicles:GetDescendants() do | |
42 | if v.Name ~= "Data" then | |
43 | table.insert(vehicles, v.Name) | |
44 | end | |
45 | end | |
46 | returns[1] = vehicles | |
47 | end | |
48 | return unpack(returns) | |
49 | else | |
50 | return oldmeta.__namecall(unpack(args)) | |
51 | end | |
52 | end | |
53 | game.Players.LocalPlayer.Character:BreakJoints() | |
54 | end |