Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:Wait()
- local tool = script.Parent
- local anim = char:WaitForChild("Humanoid"):LoadAnimation(script:WaitForChild("ParachuteAnim"))
- local bf
- tool.Equipped:Connect(function()
- game.ReplicatedStorage.ConnectM6D:FireServer(tool.BodyAttach)
- char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
- char.UpperTorso.ToolGrip.Part1 = tool.BodyAttach
- anim:Play()
- end)
- tool.Unequipped:Connect(function()
- game.ReplicatedStorage.DisconnectM6D:FireServer()
- anim:Stop()
- if bf then bf:Destroy() end
- end)
- char:WaitForChild("Humanoid").StateChanged:Connect(function(oldState, newState)
- if script.Parent.Parent ~= char then return end
- if newState == Enum.HumanoidStateType.Freefall and oldState == Enum.HumanoidStateType.Jumping then
- if bf then bf:Destroy() end
- wait(0.3)
- bf = Instance.new("BodyForce")
- bf.Force = Vector3.new(0, workspace.Gravity * 10, 0)
- bf.Parent = char.HumanoidRootPart
- elseif newState == Enum.HumanoidStateType.Landed and bf then
- bf:Destroy()
- end
- end)
Add Comment
Please, Sign In to add comment