HackerTA

Nickname Spoofer

Jun 13th, 2020
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. wait(2)
  2. Player = game.Players.LocalPlayer
  3. Char = Player.Character
  4. Head = Char.Humanoid
  5. Head.Name = "Copy"
  6. local Copy = Head:Clone()
  7. Head:Destroy()
  8. Copy.Name = " "
  9.  
  10.  
  11.  
  12. wait(2)
  13. local Config =
  14. {
  15. ProtectedName = "Splash", --What the protected name should be called.
  16. OtherPlayers = true, --If other players should also have protected names.
  17. OtherPlayersTemplate = "Splash", --Template for other players protected name (ex: "Splash" will turn into "Splash1" for first player and so on)
  18. RenameTextBoxes = false, --If TextBoxes should be renamed. (could cause issues with admin guis/etc)
  19. UseFilterPadding = false, --If filtered name should be the same size as a regular name.
  20. FilterPad = " ", --Character used to filter pad.
  21. UseMetatableHook = true, --Use metatable hook to increase chance of filtering. (is not supported on wrappers like bleu)
  22. UseAggressiveFiltering = false --Use aggressive property renaming filter. (renames a lot more but at the cost of lag)
  23. }
  24.  
  25. local ProtectedNames = {}
  26. local Counter = 1
  27. if Config.OtherPlayers then
  28. for I, V in pairs(game:GetService("Players"):GetPlayers()) do
  29. local Filter = Config.OtherPlayersTemplate .. tostring(Counter)
  30. if Config.UseFilterPadding then
  31. if string.len(Filter) > string.len(V.Name) then
  32. Filter = string.sub(Filter, 1, string.len(V.Name))
  33. elseif string.len(Filter) < string.len(V.Name) then
  34. local Add = string.len(V.Name) - string.len(Filter)
  35. for I=1,Add do
  36. Filter = Filter .. Config.FilterPad
  37. end
  38. end
  39. end
  40. ProtectedNames[V.Name] = Filter
  41. Counter = Counter + 1
  42. end
  43.  
  44. game:GetService("Players").PlayerAdded:connect(function(Player)
  45. local Filter = Config.OtherPlayersTemplate .. tostring(Counter)
  46. if Config.UseFilterPadding then
  47. if string.len(Filter) > string.len(V.Name) then
  48. Filter = string.sub(Filter, 1, string.len(V.Name))
  49. elseif string.len(Filter) < string.len(V.Name) then
  50. local Add = string.len(V.Name) - string.len(Filter)
  51. for I=1,Add do
  52. Filter = Filter .. Config.FilterPad
  53. end
  54. end
  55. end
  56. ProtectedNames[Player.Name] = Filter
  57. Counter = Counter + 1
  58. end)
  59. end
  60.  
  61. local LPName = game:GetService("Players").LocalPlayer.Name
  62. local IsA = game.IsA
  63.  
  64. if Config.UseFilterPadding then
  65. if string.len(Config.ProtectedName) > string.len(LPName) then
  66. Config.ProtectedName = string.sub(Config.ProtectedName, 1, string.len(LPName))
  67. elseif string.len(Config.ProtectedName) < string.len(LPName) then
  68. local Add = string.len(LPName) - string.len(Config.ProtectedName)
  69. for I=1,Add do
  70. Config.ProtectedName = Config.ProtectedName .. Config.FilterPad
  71. end
  72. end
  73. end
  74.  
  75. local function FilterString(S)
  76. local RS = S
  77. if Config.OtherPlayers then
  78. for I, V in pairs(ProtectedNames) do
  79. RS = string.gsub(RS, I, V)
  80. end
  81. end
  82. RS = string.gsub(RS, LPName, Config.ProtectedName)
  83. return RS
  84. end
  85.  
  86. for I, V in pairs(game:GetDescendants()) do
  87. if Config.RenameTextBoxes then
  88. if IsA(V, "TextLabel") or IsA(V, "TextButton") or IsA(V, "TextBox") then
  89. V.Text = FilterString(V.Text)
  90.  
  91. if Config.UseAggressiveFiltering then
  92. V:GetPropertyChangedSignal("Text"):connect(function()
  93. V.Text = FilterString(V.Text)
  94. end)
  95. end
  96. end
  97. else
  98. if IsA(V, "TextLabel") or IsA(V, "TextButton") then
  99. V.Text = FilterString(V.Text)
  100.  
  101. if Config.UseAggressiveFiltering then
  102. V:GetPropertyChangedSignal("Text"):connect(function()
  103. V.Text = FilterString(V.Text)
  104. end)
  105. end
  106. end
  107. end
  108. end
  109.  
  110. if Config.UseAggressiveFiltering then
  111. game.DescendantAdded:connect(function(V)
  112. if Config.RenameTextBoxes then
  113. if IsA(V, "TextLabel") or IsA(V, "TextButton") or IsA(V, "TextBox") then
  114. V:GetPropertyChangedSignal("Text"):connect(function()
  115. V.Text = FilterString(V.Text)
  116. end)
  117. end
  118. else
  119. if IsA(V, "TextLabel") or IsA(V, "TextButton") then
  120. V:GetPropertyChangedSignal("Text"):connect(function()
  121. V.Text = FilterString(V.Text)
  122. end)
  123. end
  124. end
  125. end)
  126. end
  127.  
  128. if Config.UseMetatableHook then
  129. if not getrawmetatable then
  130. error("GetRawMetaTable not found")
  131. end
  132.  
  133. local NewCC = function(F)
  134. if newcclosure then return newcclosure(F) end
  135. return F
  136. end
  137.  
  138. local SetRO = function(MT, V)
  139. if setreadonly then return setreadonly(MT, V) end
  140. if not V and make_writeable then return make_writeable(MT) end
  141. if V and make_readonly then return make_readonly(MT) end
  142. error("No setreadonly found")
  143. end
  144.  
  145. local MT = getrawmetatable(game)
  146. local OldNewIndex = MT.__newindex
  147. SetRO(MT, false)
  148.  
  149. MT.__newindex = NewCC(function(T, K, V)
  150. if Config.RenameTextBoxes then
  151. if (IsA(T, "TextLabel") or IsA(T, "TextButton") or IsA(T, "TextBox")) and K == "Text" and type(V) == "string" then
  152. return OldNewIndex(T, K, FilterString(V))
  153. end
  154. else
  155. if (IsA(T, "TextLabel") or IsA(T, "TextButton")) and K == "Text" and type(V) == "string" then
  156. return OldNewIndex(T, K, FilterString(V))
  157. end
  158. end
  159.  
  160. return OldNewIndex(T, K, V)
  161. end)
  162.  
  163. SetRO(MT, true)
  164. end
Add Comment
Please, Sign In to add comment