Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game.Players.LocalPlayer
- Player = game.Players.LocalPlayer
- char = Player.Character
- h = char.Humanoid
- tool = script.Parent
- local user
- local range = 10
- grab = false
- animTrack1 = nil
- damselAnimTrack = nil
- tool.Equipped:connect(function(mouse)
- mouse.Button1Down:connect(function()
- if grab == true then return end
- local ray = Ray.new(tool.Handle.CFrame.p, (mouse.hit.p - tool.Handle.CFrame.p).unit*range)
- local hit, position = game.Workspace:FindPartOnRay(ray, user)
- local humanoid = hit and hit.Parent:FindFirstChild("Humanoid")
- if humanoid and humanoid ~= char.Humanoid then
- grab = true
- local damselChar = humanoid.Parent
- humanoid.PlatformStand = true
- local newHandle = tool.Handle:Clone()
- newHandle.Parent = char
- local newWeld = Instance.new("ManualWeld", char)
- newWeld.Part0 = newHandle
- newWeld.Part1 = char.Torso
- local weld = Instance.new("ManualWeld", char)
- weld.Part0 = newHandle
- weld.Part1 = damselChar.HumanoidRootPart
- weld.C0 = CFrame.new(1.6, .3, -1.8)
- animTrack1 = h:LoadAnimation(tool.damsel1)
- animTrack1:Play()
- damselAnimTrack = humanoid:LoadAnimation(tool.damsel2)
- damselAnimTrack:Play()
- tool.Unequipped:connect(function()
- humanoid.PlatformStand = false
- grab = false
- animTrack1:Stop()
- damselAnimTrack:Stop()
- weld:Destroy()
- newHandle:Destroy()
- newWeld:Destroy()
- end)
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement