Advertisement
Capybara_ele

British Army Cuffs

Nov 1st, 2024
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | Gaming | 0 0
  1. local Tool = script.Parent
  2. local Players = game:GetService("Players")
  3.  
  4. -- Function to cuff the target player
  5. local function cuffPlayer(targetPlayer)
  6.     if targetPlayer and targetPlayer.Character then
  7.         local character = targetPlayer.Character
  8.        
  9.         -- Add a 'Cuffed' value to the target player
  10.         local cuffedValue = Instance.new("BoolValue")
  11.         cuffedValue.Name = "Cuffed"
  12.         cuffedValue.Value = true
  13.         cuffedValue.Parent = targetPlayer
  14.  
  15.         -- Optionally, you can disable movement
  16.         local humanoid = character:FindFirstChildOfClass("Humanoid")
  17.         if humanoid then
  18.             humanoid.PlatformStand = true -- Disable movement
  19.         end
  20.  
  21.         -- You can also add a visual effect or change the player's appearance here
  22.  
  23.         -- Wait for a few seconds (or until uncuffed)
  24.         wait(5) -- Duration cuffs are applied
  25.  
  26.         -- Uncuff the player
  27.         cuffedValue.Value = false
  28.         humanoid.PlatformStand = false -- Enable movement again
  29.  
  30.         cuffedValue:Destroy() -- Clean up
  31.     end
  32. end
  33.  
  34. -- Function to handle tool activation
  35. local function onActivated()
  36.     local player = Players:GetPlayerFromCharacter(Tool.Parent)
  37.     if player then
  38.         local mouse = player:GetMouse()
  39.         local target = mouse.Target
  40.        
  41.         if target then
  42.             local targetPlayer = Players:GetPlayerFromCharacter(target.Parent)
  43.             if targetPlayer and targetPlayer ~= player then
  44.                 cuffPlayer(targetPlayer)
  45.             end
  46.         end
  47.     end
  48. end
  49.  
  50. Tool.Activated:Connect(onActivated)
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement