Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local playerTrails = {}
- local trailParts = {"LeftHand", "RightHand", "LeftFoot", "RightFoot"}
- game.ReplicatedStorage:WaitForChild("SkydiveRE").OnServerEvent:Connect(function(plr, skydiving)
- if skydiving == true then
- playerTrails[plr] = {}
- for i, partName in pairs(trailParts) do
- local trail = script.Trail:Clone()
- local bodyPart = plr.Character[partName]
- local atch0 = Instance.new("Attachment", bodyPart)
- atch0.Position = Vector3.new(0.5, 0, 0)
- local atch1 = Instance.new("Attachment", bodyPart)
- atch1.Position = Vector3.new(-0.5, 0, 0)
- trail.Attachment0 = atch0
- trail.Attachment1 = atch1
- trail.Parent = bodyPart
- table.insert(playerTrails[plr], trail)
- table.insert(playerTrails[plr], atch0)
- table.insert(playerTrails[plr], atch1)
- end
- elseif skydiving == false and playerTrails[plr] then
- for i, trail in pairs(playerTrails[plr]) do
- trail:Destroy()
- end
- elseif skydiving == "parachute" then
- local bv = Instance.new("BodyVelocity", plr.Character.HumanoidRootPart)
- bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- bv.Velocity = Vector3.new(0, -100, 0)
- local parachute = script.Parachute:Clone()
- parachute.Parent = plr.Character.UpperTorso
- local weld = Instance.new("Weld", plr.Character.UpperTorso)
- weld.Part0 = plr.Character.UpperTorso
- weld.Part1 = parachute.MainPart
- weld.C1 = CFrame.new(0, 0, 0.5)
- elseif skydiving == "landed" then
- for i, descendant in pairs(plr.Character:GetDescendants()) do
- if descendant:IsA("BodyVelocity") or descendant.Name == "Parachute" then
- descendant:Destroy()
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement