Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Tool = script.Parent
- local Players = game:GetService("Players")
- -- Function to cuff the target player
- local function cuffPlayer(targetPlayer)
- if targetPlayer and targetPlayer.Character then
- local character = targetPlayer.Character
- -- Add a 'Cuffed' value to the target player
- local cuffedValue = Instance.new("BoolValue")
- cuffedValue.Name = "Cuffed"
- cuffedValue.Value = true
- cuffedValue.Parent = targetPlayer
- -- Optionally, you can disable movement
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid.PlatformStand = true -- Disable movement
- end
- -- You can also add a visual effect or change the player's appearance here
- -- Wait for a few seconds (or until uncuffed)
- wait(5) -- Duration cuffs are applied
- -- Uncuff the player
- cuffedValue.Value = false
- humanoid.PlatformStand = false -- Enable movement again
- cuffedValue:Destroy() -- Clean up
- end
- end
- -- Function to handle tool activation
- local function onActivated()
- local player = Players:GetPlayerFromCharacter(Tool.Parent)
- if player then
- local mouse = player:GetMouse()
- local target = mouse.Target
- if target then
- local targetPlayer = Players:GetPlayerFromCharacter(target.Parent)
- if targetPlayer and targetPlayer ~= player then
- cuffPlayer(targetPlayer)
- end
- end
- end
- end
- Tool.Activated:Connect(onActivated)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement