Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Local Script--
- local Player = game.Players.LocalPlayer
- local Chr = Player.Character or Player.CharacterAdded:Wait()
- local Mouse = Player:GetMouse()
- local Tool = script.Parent
- local Mode
- local Using = false
- local PTorso
- local RemoteEvent = script.Parent.RemoteEvent
- if Chr:FindFirstChild'UpperTorso' then
- PTorso = Chr:WaitForChild("Torso")
- else
- PTorso = Chr:WaitForChild("Torso")
- end
- Tool.Activated:Connect(function()
- if not Using then
- if Mouse.Target then
- RemoteEvent:FireServer('Cuff', Mouse.Target)
- end
- else
- Using = false
- RemoteEvent:FireServer('UnCuff')
- end
- end)
- RemoteEvent.OnClientEvent:Connect(function( one )
- if one == 'Use' then
- Using = true
- end
- end)
- --Server Script--
- --Scripted by bowypenguino
- --BOWYSOFT
- local RemoteEvent = script.Parent.RemoteEvent
- local Using = false
- local TargetTorso
- function CheckForChar(Part)
- if Part.Parent:IsA'Model' and Part.Parent:FindFirstChildOfClass'Humanoid' then
- local Char = Part.Parent
- local Torso
- if Char:FindFirstChild("Torso") then
- Torso = Char.Torso
- else
- Torso = Char.UpperTorso
- end
- TargetTorso = Torso
- return Char
- end
- end
- function CheckForTorso(player)
- local Char = player.Character
- if Char:FindFirstChild("Torso") then
- return Char.Torso
- else
- return Char.UpperTorso
- end
- end
- RemoteEvent.OnServerEvent:Connect(function(player, one, two)
- if one == 'Cuff' then
- local Target = CheckForChar(two)
- local PlayerTorso = CheckForTorso(player)
- if Target then
- Using = true
- RemoteEvent:FireClient(player, 'Use')
- spawn(function()
- while Using and wait() do
- TargetTorso.Anchored = true
- TargetTorso.CFrame = PlayerTorso.CFrame * CFrame.new( 0, 0, -2.5 )
- if TargetTorso.Parent.Humanoid.Health >= 0 then
- TargetTorso.Cframe = true
- TargetTorso.CFrame = PlayerTorso.CFrame * CFrame.new( 0, 0, -2.5 )
- end
- end
- end)
- end
- elseif one == 'UnCuff'then
- Using = false
- wait()
- TargetTorso.Anchored = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement