Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --this script is by susmic123_real-
- local banHammer = Instance.new("Tool")
- banHammer.Name = "BanHammer"
- -- Define a function to ban a player
- local function banPlayer(player)
- -- Insert your ban logic here (e.g., kick or remove them from the game)
- print("Banning player: " .. player.Name)
- player:Kick("You have been banned by an admin.")
- end
- -- Define what happens when the tool is activated
- banHammer.Activated:Connect(function()
- local character = game.Players.LocalPlayer.Character
- local humanoid = character:FindFirstChild("Humanoid")
- local mouse = game.Players.LocalPlayer:GetMouse()
- if humanoid and humanoid.Health > 0 then
- local target = mouse.Target
- if target and target.Parent:FindFirstChild("Humanoid") then
- local targetHumanoid = target.Parent:FindFirstChild("Humanoid")
- local targetPlayer = game.Players:GetPlayerFromCharacter(target.Parent)
- if targetPlayer then
- banPlayer(targetPlayer)
- end
- end
- end
- end)
- -- Add the Ban Hammer tool to the player's Backpack
- game.Players.LocalPlayer.Backpack:WaitForChild("BanHammer")
- banHammer.Parent = game.Players.LocalPlayer.Backpack
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement