Joriangames

Touch part to get banned script

Apr 30th, 2021
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. --Thanks for using this script
  2. --This script is made by Joriangames/Problox Studio Scripts
  3. --Want to know how to use this? Watch my tutorial: https://youtu.be/8IcNqEHg4b8
  4. local DSS = game:GetService("DataStoreService")
  5. local banDS = DSS:GetDataStore("banDS")
  6.  
  7.  
  8. script.Parent.Touched:Connect(function(hit)
  9.     if hit.Parent:FindFirstChild("Humanoid") then
  10.         local char = hit.Parent
  11.         local plr = game.Players:GetPlayerFromCharacter(char)
  12.         local userId = plr.UserId
  13.        
  14.        
  15.         local succ, err = pcall(function()
  16.             banDS:SetAsync(userId, true)
  17.         end)
  18.        
  19.         if succ then
  20.             print("player got banned!")
  21.         end
  22.        
  23.         plr:Kick("You got banned from the game!")
  24.     end
  25. end)
Advertisement
Add Comment
Please, Sign In to add comment