Advertisement
LukeMotionz

Advanced RemoteSpy Script

Mar 10th, 2018
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.10 KB | None | 0 0
  1. --toggle classes by switching true/false
  2. SpyOn = {
  3. RemoteEvent = true;
  4. RemoteFunction = true;
  5. BindableEvent = false;
  6. BindableFunction = false;
  7. }
  8. --if true will spy 'hidden' events
  9. spyNilInstances = false
  10. --if true can spy more, but helps anti-exploits
  11. spy__index = false
  12. --maximum number of sections at once
  13. numMaxSections = 25
  14. --size of padding inside sections
  15. yindent = 20
  16. --/////////////////////////////////////////////////////////////////////////////////////
  17.  
  18. if not (getrawmetatable and (setclipboard or Synapse)) then
  19. warn("Please run this with a suitable exploit")
  20. return
  21. end
  22.  
  23. local MT = getrawmetatable(game)
  24. if setreadonly then setreadonly(MT,false) end
  25. if make_writeable then make_writeable(MT) end
  26. local oldNamecall = MT.__namecall
  27. local oldIndex = MT.__index
  28.  
  29. local Player = game:GetService("Players").LocalPlayer
  30. --basically makes a background
  31. MakeShadow = function(GUI, Deepness)
  32. for i=1, Deepness do
  33. local G = GUI:Clone()
  34. G.ZIndex = GUI.ZIndex - 1
  35. G.Size=UDim2.new(1,12,1,12)
  36. G.Position=UDim2.new(0,-6,0,-6)
  37. G.Active=false
  38. G.Draggable=false
  39. G:ClearAllChildren()
  40. G.Name = GUI.Name.." Shadow"
  41. G.Parent = GUI
  42. end
  43. end
  44. --create basic frames
  45. local CanScroll = true
  46. local GUI = Instance.new("ScreenGui", Player.PlayerGui)
  47. GUI.Name = "GUI"
  48. GUI.ResetOnSpawn = false
  49. GUI.DisplayOrder = 10000
  50. local Main = Instance.new("Frame", GUI)
  51. Main.Active = true
  52. Main.ZIndex = 10000
  53. Main.Size = UDim2.new(0.27, 0, 0.32, 0)
  54. Main.Draggable = true
  55. Main.Style = "DropShadow"
  56. Main.Position = UDim2.new(0.05, 0, 0.05, 0)
  57. MakeShadow(Main, 4)
  58. local Bar = Instance.new("Frame", Main)
  59. Bar.BackgroundColor3=Color3.fromRGB(40,40,40)
  60. Bar.Size = UDim2.new(1, 20, 0.13, 0)
  61. Bar.Position = UDim2.new(0, -10, -0.03)
  62. Bar.ZIndex = Main.ZIndex+1
  63. local Title = Instance.new("TextLabel", Bar)
  64. Title.BackgroundTransparency = 1
  65. Title.Position=UDim2.new(0,10)
  66. Title.TextColor3 = Color3.new(1, 1, 1)
  67. Title.Font = "SourceSansBold"
  68. Title.Text = "Remote Spy"
  69. Title.TextSize = 15
  70. Title.ZIndex = Main.ZIndex+3
  71. Title.TextXAlignment = "Left"
  72. Title.Size = UDim2.new(1, 0, 1, 0)
  73. local Exit = Instance.new("TextButton", Bar)
  74. Exit.BackgroundTransparency = 1
  75. Exit.Text = "x"
  76. Exit.TextColor3 = Color3.new(1, 1, 1)
  77. Exit.Size = UDim2.new(0.08, 0, 1.5, 0)
  78. Exit.TextSize = 20
  79. Exit.TextWrapped = false
  80. Exit.Position = UDim2.new(0.95, -10, -0.28, 0)
  81. Exit.Font = "SourceSansBold"
  82. Exit.ZIndex = Main.ZIndex+1
  83. Exit.MouseButton1Up:connect(function()
  84. GUI:Destroy()
  85. MT.__namecall = oldNamecall
  86. MT.__index = oldIndex
  87. end)
  88. Exit.MouseEnter:connect(function()
  89. Exit.TextColor3 = Color3.new(1, 0, 0)
  90. end)
  91. Exit.MouseLeave:connect(function()
  92. Exit.TextColor3 = Color3.new(1, 1, 1)
  93. end)
  94. local Scroll = Instance.new("ScrollingFrame", Main)
  95. Scroll.BackgroundTransparency = 1
  96. Scroll.Name = "Scroll"
  97. Scroll.Size = UDim2.new(1, 0, 0.9, 0)
  98. Scroll.ZIndex = Main.ZIndex+1
  99. Scroll.Position = UDim2.new(0, 0, 0.1, 0)
  100. Scroll.BorderSizePixel = 0
  101. Scroll.CanvasSize = UDim2.new()
  102. --clipboard gui
  103. local Popup = Instance.new("TextButton",GUI)
  104. Instance.new("StringValue",Popup).Name = "ToCopy"
  105. Popup.Name="ClipboardBtn"
  106. Popup.Text="Copy"
  107. Popup.Size=UDim2.new(0,40,0,20)
  108. Popup.ZIndex=Main.ZIndex+4
  109. Popup.MouseButton1Down:Connect(function()
  110. Popup.Visible=false
  111. if setclipboard then
  112. setclipboard(Popup.ToCopy.Value)
  113. else
  114. Synapse:CopyString(Popup.ToCopy.Value)
  115. end
  116. Popup.Visible=false
  117. end)
  118. --bottom-right resizer
  119. --////
  120. local resize = Instance.new("ImageButton")
  121. resize.Name = "resize"
  122. resize.BackgroundTransparency = 1
  123. resize.Image = "rbxassetid://55927414"
  124. resize.ZIndex = Main.ZIndex+1
  125. resize.Size = UDim2.new(0,13,0,13)
  126. resize.Position = UDim2.new(1,-9,1,-9)
  127. resize.Active=true
  128. resize.Draggable=true
  129. local resizing=false
  130. local mouseConn
  131. resize.DragBegin:Connect(function()
  132. --basically moves sizer to only absolutes..
  133. local rAP = resize.AbsolutePosition
  134. resize.Parent = GUI
  135. resize.Position = UDim2.new(0,rAP.X,0,rAP.Y)
  136. --then offsets main size based on those values
  137. local mS = Main.Size
  138. local mAS = Main.AbsoluteSize
  139. local addX,addY=0,0
  140. mouseConn = Player:GetMouse().Move:Connect(function()
  141. --most of this is to keep stuff from going negative
  142. addX,addY = math.max(-mAS.X+240,resize.AbsolutePosition.X - rAP.X),math.max(-mAS.Y+100,resize.AbsolutePosition.Y - rAP.Y)
  143. Main.Size=mS + UDim2.new(0,addX,0,addY)
  144. --hide if negative
  145. if addX>-mAS.X+240 and addY>-mAS.Y+100 then
  146. resize.ImageTransparency = 0
  147. else
  148. resize.ImageTransparency = 1
  149. end
  150. end)
  151. end)
  152. resize.DragStopped:Connect(function()
  153. --turn to normal
  154. resize.Parent = Main
  155. resize.Position = UDim2.new(1,-9,1,-9)
  156. resize.ImageTransparency = 0
  157. mouseConn:Disconnect()
  158. end)
  159. resize.Parent = Main
  160. --////
  161. Instance.new("UIListLayout",Scroll).SortOrder = Enum.SortOrder.LayoutOrder
  162. local sectionIndex = 0
  163.  
  164. local Console = {}
  165. Console.White = Color3.new(1, 1, 1)
  166. Console.LightGray = Color3.fromRGB(155, 155, 155)
  167. local CurrentColour = Console.White
  168. local CurrentSection
  169. local NumLabels = 0
  170. local sections = {}
  171.  
  172. function Console:WriteLine(Text)
  173. pcall(function()
  174. if CurrentSection and tostring(Text) then
  175. NumLabels=NumLabels+1
  176. local TL = Instance.new("TextLabel")
  177. TL.Parent = CurrentSection
  178. TL.Text = tostring(Text)
  179. TL.TextColor3 = CurrentColour
  180. TL.BackgroundTransparency = 1
  181. TL.Font = "SourceSansBold"
  182. TL.TextSize = 14
  183. TL.ZIndex = Main.ZIndex+3
  184. TL.TextXAlignment = "Left"
  185. TL.TextWrapped = false
  186. TL.Size = UDim2.new(1, 0, 0, 20)
  187. local Y = #CurrentSection:GetChildren()*20
  188. TL.Position = UDim2.new(0, 0, 0, Y-20 + yindent/2)
  189. CurrentSection.Size = UDim2.new(1, 0, 0, Y + yindent)
  190. if CanScroll then
  191. Scroll.CanvasSize = UDim2.new(0, 0, 0, NumLabels*20)
  192. Scroll.CanvasPosition = Vector2.new(0, Scroll.CanvasSize.Y.Offset)
  193. end
  194. end
  195. end)
  196. end
  197. function Console:SetColor(Color)
  198. CurrentColour = Color
  199. end
  200. function Console:PushSection(ClipboardText)
  201. if #sections < numMaxSections then --if going to add a section
  202. NumLabels=NumLabels+(yindent/20) --just increases scroller size
  203. end
  204. sectionIndex=sectionIndex+1
  205. local f = Instance.new("TextButton")
  206. f.BackgroundTransparency = 1 - (0.07 * (sectionIndex % 2)) --alternate colors
  207. f.BorderSizePixel=2
  208. f.BorderColor3=Color3.new(1,1,1)
  209. f.ZIndex = Main.ZIndex+2
  210. f.Size = UDim2.new()
  211. f.Text = ""
  212. f.AutoButtonColor = false
  213.  
  214. if ClipboardText~=nil then
  215. --on right click show copy option label, which copies text when clicked
  216. f.MouseButton2Up:Connect(function()
  217. Popup.ToCopy.Value = ClipboardText
  218. Popup.Position = UDim2.new(0,Player:GetMouse().X,0,Player:GetMouse().Y)
  219. Popup.Visible=true
  220. game:GetService("UserInputService").InputBegan:Wait()
  221. wait()
  222. Popup.Visible=false
  223. end)
  224. end
  225.  
  226. f.LayoutOrder = sectionIndex --for UIListLayout
  227. if #sections >= numMaxSections and CanScroll then
  228. --removes any extra sections. limited by CanScroll or else the rotations will still look like scrolling
  229. for i=0,#sections-numMaxSections do
  230. NumLabels = NumLabels - #sections[1]:GetChildren()
  231. sections[1]:Destroy()
  232. table.remove(sections,1)
  233. end
  234. end
  235. sections[#sections+1]=f
  236. f.Parent = Scroll
  237.  
  238. CurrentSection = f
  239. end
  240.  
  241. Console:SetColor(Console.White)
  242.  
  243. Main.MouseEnter:connect(function()
  244. CanScroll = false
  245. end)
  246. Main.MouseLeave:connect(function()
  247. CanScroll = true
  248. --"unpause"
  249. for i=1,#sections-numMaxSections do
  250. NumLabels = NumLabels - #sections[1]:GetChildren()
  251. sections[1]:Destroy()
  252. table.remove(sections,1)
  253. end
  254. Scroll.CanvasSize = UDim2.new(0, 0, 0, NumLabels*20)
  255. end)
  256.  
  257. local function _tostring(x)
  258. local typ = typeof(x)
  259. if typ == "table" then
  260. return tableToString(x)
  261. elseif typ == "string" then
  262. return '"'..x..'"'
  263. elseif typ == "Vector3" then
  264. return string.format("Vector3.new(%g,%g,%g)",x.X,x.Y,x.Z)
  265. elseif typ == "Color3" then
  266. return string.format("Color3.new(%g,%g,%g)",x.r,x.g,x.b)
  267. elseif typ == "Vector2" then
  268. return string.format("Vector2.new(%g,%g)",x.X,x.Y)
  269. elseif typ == "CFrame" then
  270. return string.format("CFrame.new(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",x:components())
  271. elseif typ == "UDim2" then
  272. return string.format("UDim2.new(%g,%g,%g,%g)",x.X.Scale,x.X.Offset,x.Y.Scale,x.Y.Offset)
  273. elseif typ == "Instance" then
  274. return x:GetFullName()
  275. end
  276.  
  277. return tostring(x)
  278. end
  279.  
  280. function tableToString(tab)
  281. local str = "{ "
  282. local len = #tab
  283.  
  284. local c = 1
  285. for k,v in pairs(tab) do
  286. if (k==c and k<=len) then
  287. --array part
  288. str = str .. _tostring(v) .. ", "
  289. c = c + 1
  290. else
  291. --dict part
  292. str = str .. "[" .. _tostring(k) .. "]= " .. _tostring(v) .. ", "
  293. end
  294. end
  295.  
  296. str = str:sub(1,math.max(1,#str-2)) .. " }"
  297. return str
  298. end
  299.  
  300. toConsole = function(method, event, Args, Returned)
  301. local nilParent = game:IsAncestorOf(event)==false
  302. if (spyNilInstances==false and nilParent==true) or (event.Name=="CharacterSoundEvent" and event.Parent.ClassName=="Sound") then
  303. --ignored an event
  304. return
  305. end
  306. pcall(function()
  307. local stringArgs = tableToString(Args):sub(3,-3)
  308. local pre = nilParent and "" or "game."
  309. Console:PushSection(string.format(pre .."%s:%s(%s)",event:GetFullName(),method,stringArgs))
  310. Console:WriteLine(string.format("%s.%s called!",event.ClassName,method))
  311. Console:WriteLine("Path: "..event:GetFullName())
  312. Console:WriteLine("Args: "..stringArgs)
  313. if Returned and #Returned>0 then
  314. Console:WriteLine("Returned: ".. tableToString(Returned):sub(3,-3))
  315. end
  316. end)
  317. end
  318.  
  319. MT.__namecall = function(inst,...)
  320. local args = {...}
  321. local m = args[#args]
  322. args[#args]=nil
  323. if (m=="FireServer" or m=="Fire" or m=="InvokeServer" or m=="Invoke") and SpyOn[inst.ClassName] then
  324. local returned = {oldNamecall(inst,...)}
  325. toConsole(m, inst, args, returned)
  326. return unpack(returned)
  327. end
  328. return oldNamecall(inst,...)
  329. end
  330.  
  331. if spy__index==true then
  332. --incase coder called event without methods
  333. local realMethods = {FireServer=Instance.new("RemoteEvent").FireServer, Fire = Instance.new("BindableEvent").Fire,
  334. InvokeServer = Instance.new("RemoteFunction").InvokeServer, Invoke = Instance.new("BindableFunction").Invoke}
  335. MT.__index = function(inst,m)
  336. if (m=="FireServer" or m=="Fire" or m=="InvokeServer" or m=="Invoke") and SpyOn[inst.ClassName] then
  337. return function(_,...)
  338. local returned = {realMethods[m](inst,...)}
  339. toConsole(m, inst, {...}, returned)
  340. return unpack(returned)
  341. end
  342. end
  343. return oldIndex(inst,m)
  344. end
  345. end
  346.  
  347. Console:PushSection()
  348. Console:WriteLine("Right-click any section for clipboard option")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement