CHoff719

idk

Jun 4th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. --[[
  2. --//Scripted by AnimeWiki
  3. --//06.16.2015
  4. --//http://www.roblox.com/User.aspx?ID=71436898
  5. ]]
  6.  
  7. local datastore;
  8.  
  9. if script.ClassName ~= "LocalScript" then
  10. datastore = game:GetService("DataStoreService"):GetDataStore("SBan");
  11. if not datastore:GetAsync("trusted") then
  12. index = datastore:SetAsync("trusted",{});
  13. else
  14. index = datastore:GetAsync("trusted",{});
  15. end;
  16.  
  17. end;
  18.  
  19.  
  20.  
  21. local player = owner or game:GetService("Players").LocalPlayer;
  22.  
  23.  
  24.  
  25. if not index then
  26. index = {
  27. {Name = player.Name};
  28. };
  29. end;
  30.  
  31.  
  32.  
  33.  
  34. local FindPlayer = function(playername)
  35. for k,v in pairs(index) do
  36. if v.Name == playername then
  37. return v;
  38. end;
  39. end;
  40. return nil;
  41. end;
  42.  
  43. if not FindPlayer(player.Name) then
  44. index[#index + 1] = {Name = player.Name}
  45. end
  46.  
  47. local part;
  48.  
  49. local size = 20;
  50.  
  51. player.Chatted:connect(function(message)
  52. if string.sub(message:lower(),1,6) == "trust " then
  53. for k,v in pairs(game:GetService("Players"):GetPlayers()) do
  54. if string.sub(v.Name:lower(),1,string.len(string.sub(message,7))) == string.sub(message:lower(),7) then
  55. if not FindPlayer(v.Name) then
  56. print(v.Name,"trusted now.");
  57. index[#index + 1] = {Name = v.Name};
  58. if datastore then
  59. datastore:SetAsync("trusted",index);
  60. end;
  61. end;
  62. end;
  63. end;
  64.  
  65. elseif string.sub(message:lower(),1,5) == "size " then
  66. if part then
  67. size = tonumber(string.sub(message:lower(),6)) or 20;
  68. part.Size = Vector3.new(size,0.1,size);
  69. part.CFrame = CFrame.new(0,1,0);
  70. print(size);
  71. end;
  72.  
  73. elseif string.sub(message:lower(),1,7) == "remove " then
  74. for k,v in pairs(game:GetService("Players"):GetPlayers()) do
  75. if string.sub(v.Name:lower(),1,string.len(string.sub(message,8))) == string.sub(message:lower(),8) then
  76. local result = v;
  77. --print(result.Name);
  78. for k,v in pairs(index) do
  79. if v.Name == result.Name and v.Name ~= player.Name then
  80. index[k] = nil;
  81. print(result.Name,"is removed now.");
  82. if datastore then
  83. datastore:SetAsync("trusted",index);
  84. end;
  85. end;
  86. end;
  87. end;
  88. end;
  89. end;
  90. end);
  91.  
  92.  
  93. local reDefinePart;
  94.  
  95. --local event;
  96.  
  97. reDefinePart = function()
  98. part = Instance.new("Part", game:GetService("Workspace"));
  99. part.Shape = "Block"
  100. part.FormFactor = "Custom";
  101. part.Size = Vector3.new(size,0.1,size);
  102. part.Anchored = true;
  103. part.Locked = true;
  104. part.CanCollide = true;
  105. part.CFrame = CFrame.new(0,1,0);
  106. part.BottomSurface = "Smooth";
  107. part.BrickColor = BrickColor.new("Medium blue");
  108. part.TopSurface = "Smooth";
  109. part.Transparency = 0.2;
  110.  
  111. --[[ event = part.Changed:connect(function(value)
  112. if value ~= "Parent" and value ~= "Size" then
  113. part:remove();
  114. reDefinePart();
  115. if event then
  116. event:disconnect();
  117. end;
  118. end;
  119. end);]]
  120. end;
  121.  
  122.  
  123. reDefinePart();
  124.  
  125. game:GetService("Workspace").DescendantRemoving:connect(function(child)
  126. if part and child == part then
  127. reDefinePart();
  128. end;
  129. end);
  130.  
  131.  
  132.  
  133. local loop = coroutine.create(function()
  134. local victims = {};
  135. while true do
  136. if part then
  137. for k,v in pairs(game:GetService("Workspace"):GetChildren()) do
  138. if v:FindFirstChild("Torso") then
  139. local mag = (v:FindFirstChild("Torso").CFrame.p - part.CFrame.p).magnitude;
  140. if mag <= 25 and not FindPlayer(v.Name) and not victims[v.Name] then
  141.  
  142. for k,v in pairs(v:GetChildren()) do
  143. if v.ClassName == "Part" then
  144. v.Anchored = false;
  145. end;
  146. end;
  147.  
  148. for k,v in pairs(v:FindFirstChild("Torso"):GetChildren()) do
  149. if v.ClassName == "BodyPosition" or v.ClassName == "BodyGyro" then
  150. v:remove();
  151. end;
  152. end;
  153.  
  154. victims[v.Name] = true;
  155. local bodypos = Instance.new("BodyPosition", v:FindFirstChild("Torso"));
  156. bodypos.D = 1250;
  157. bodypos.P = 10000;
  158. bodypos.maxForce = Vector3.new(math.huge,math.huge,math.huge);
  159. bodypos.position = Vector3.new(-v:FindFirstChild("Torso").CFrame.lookVector.X*100,0,-v:FindFirstChild("Torso").CFrame.lookVector.Z*100);
  160. coroutine.wrap(function()
  161. wait(1);
  162. victims[v.Name] = nil;
  163. if bodypos then
  164. bodypos:remove();
  165. end;
  166. end)();
  167. end;
  168. end;
  169. end;
  170. end;
  171. wait();
  172. end;
  173. end);
  174.  
  175.  
  176. local save = coroutine.create(function()
  177. while wait(10) do
  178. if datastore then
  179. datastore:SetAsync("trusted",index);
  180. else
  181. break;
  182. end;
  183. end;
  184. end);
  185.  
  186. coroutine.resume(loop);
  187. coroutine.resume(save);
Advertisement
Add Comment
Please, Sign In to add comment