Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- random = {211179008,0}--add id by [,0] or [,12892312] put a music id in [,here]
- vol2 = {1,2,3,4,5,6,7,8,9,10}-- add volume
- player = game:GetService("Players").LocalPlayer
- randomizesound = random[math.random(1,#random)]
- randomizevol = vol2[math.random(1,#vol2)]
- mouse = player:GetMouse()
- mouse.KeyDown:connect(function(key)
- if key == "z" then
- sound = Instance.new("Sound")
- sound.Volume = 4
- sound.Pitch = 1
- sound.SoundId = "rbxassetid://"..randomizesound
- sound.Parent = player.Character.HumanoidRootPart
- elseif key == "x" then
- sound.Volume = randomizevol
- elseif key == "c" or "v" then-- no music or mute
- sound:Stop()
- else
- sound:Play()
- end
- end)
- fly = true
- ragdoll = true
- if fly == true then
- wait(1)
- Character = game.Players.LocalPlayer.Character
- Camera = game.Workspace.CurrentCamera
- Mouse = game.Players.LocalPlayer:GetMouse()
- RArmJoint = Character.Torso:FindFirstChild("Right Shoulder")
- LArmJoint = Character.Torso:FindFirstChild("Left Shoulder")
- RHipJoint = Character.Torso:FindFirstChild("Right Hip")
- LHipJoint = Character.Torso:FindFirstChild("Left Hip")
- Tilt = 0
- TiltConvergence = 0
- Twist = 0
- TwistConvergence = 0
- Speed = 0.975
- SpeedConvergence = 0.975
- SD = 0.95
- Flat = Vector3.new(1, 0, 1)
- CurrentCameraLV = nil
- MinVelocity = -100
- HasReset = false
- Flying = false
- function KeyPressed(Key)
- if Key == "d" then
- TwistConvergence = 1
- elseif Key == "a" then
- TwistConvergence = -1
- elseif Key == "w" then
- TiltConvergence = 1
- elseif Key == "s" then
- TiltConvergence = -1
- elseif Key == "f" then
- SD = 0.95
- SpeedConvergence = 0.66
- end
- print(3)
- end
- function KeyUnpressed(Key)
- if Key == "d" or Key == "a" then
- TwistConvergence = 0
- elseif Key == "w" or Key == "s" then
- TiltConvergence = 0
- elseif Key == " f" then
- SD = 0.975
- SpeedConvergence = 1
- end
- print(4)
- end
- Mouse.KeyDown:connect(KeyPressed)
- Mouse.KeyUp:connect(KeyUnpressed)
- function ChangeWeld(Weld, C0, C1)
- Weld.C0, Weld.C1 = C0, C1
- end
- function MakeRay(From, To)
- local Hit, Position = game.Workspace:FindPartOnRay(Ray.new(From, To - From), Character)
- return {Hit = Hit, Position = Position}
- end
- while true do
- wait()
- Twist = (Twist * 31 + TwistConvergence) / 32
- Tilt = (Tilt * 31 + TiltConvergence) / 32
- Speed = (Speed * 15 + SpeedConvergence) / 16
- if Character.Torso.Velocity.y < MinVelocity and not Character.Humanoid.Sit then
- Character.Animate.Disabled = true
- VMag = math.sqrt(Character.Torso.Velocity.magnitude / 48)
- DMag = ((Character.Torso.CFrame * CFrame.Angles(1.57, 0, 0)).lookVector - Character.Torso.Velocity.unit).magnitude
- MinVelocity = -50
- HasReset = false
- Character.Humanoid.PlatformStand = true
- Raise = math.max(math.min(Character.Torso.Velocity.y / 800 - (DMag * VMag / 4), 1), -1)
- ChangeWeld(RArmJoint,
- CFrame.new(1.5, 0.5, 0) * CFrame.Angles(Raise, (math.random() * 0.2 - 0.1) * Raise, 2.355 / Speed - 1.57 - Twist / 1.5),
- CFrame.new(0, 0.5, 0))
- ChangeWeld(LArmJoint,
- CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(Raise, (math.random() * 0.2 - 0.1) * Raise, -2.355 / Speed + 1.57 - Twist / 1.5),
- CFrame.new(0, 0.5, 0))
- ChangeWeld(RHipJoint,
- CFrame.new(0.5, -1, 0) * CFrame.Angles(Raise, (math.random() * 0.2 - 0.1) * Raise, 1.046 / Speed - 0.698 - Twist / 1.5),
- CFrame.new(0, 1, 0))
- ChangeWeld(LHipJoint,
- CFrame.new(-0.5, -1, 0) * CFrame.Angles(Raise, (math.random() * 0.2 - 0.1) * Raise, -1.046 / Speed + 0.698 - Twist / 1.5),
- CFrame.new(0, 1, 0))
- CurrentCameraLV = (game.Workspace.CurrentCamera.CoordinateFrame.lookVector * Flat).unit
- Character.Torso.CFrame = CFrame.new(Character.Torso.Position, Character.Torso.Position + ((Character.Torso.CFrame * CFrame.Angles(1.57, 0, 0)).lookVector * Flat * 15 + CurrentCameraLV)/16) * CFrame.Angles(-Tilt - 1.57, Twist, 0)
- Character.Torso.Velocity = Character.Torso.Velocity*SD + CurrentCameraLV*Tilt*5 + Vector3.new(-CurrentCameraLV.z, 0, CurrentCameraLV.x)*Twist*5
- Character.Torso.RotVelocity = Vector3.new(0, 0, 0)
- elseif not HasReset then
- Character.Animate.Disabled = false
- MinVelocity = -100
- Character.Humanoid.PlatformStand = false
- RArmJoint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(0, math.pi/2, 0)
- RArmJoint.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, math.pi/2, 0)
- LArmJoint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(0, -math.pi/2, 0)
- LArmJoint.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, -math.pi/2, 0)
- RHipJoint.C0 = CFrame.new(0.5, -1, 0) * CFrame.Angles(0, math.pi/2, 0)
- RHipJoint.C1 = CFrame.new(0, 1, 0) * CFrame.Angles(0, math.pi/2, 0)
- LHipJoint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, -math.pi/2, 0)
- LHipJoint.C1 = CFrame.new(0, 1, 0) * CFrame.Angles(0, -math.pi/2, 0)
- HasReset = true
- end
- end
- end
- --[[ This may take time, use this script in your own scripts just to add a ragdoll whenever you die, works for only r6 people
- ]]
- if ragdoll == true then
- HUMANOID = game.Players.LocalPlayer.Character.Humanoid
- wait()
- if HUMANOID.RigType ~= Enum.HumanoidRigType.R6 then
- game.Debris:AddItem(script,1)
- else
- wait()
- function getAttachment0(attachmentName)
- for _,child in next,script.Parent:GetChildren() do
- local attachment = child:FindFirstChild(attachmentName)
- if attachment then
- return attachment
- end
- end
- end
- HUMANOID.Died:Connect(function(var)
- local removeHRP = true
- local head = HUMANOID.Parent.Head
- local leftarm = HUMANOID.Parent["Left Arm"]
- local leftleg = HUMANOID.Parent["Left Leg"]
- local rightleg = HUMANOID.Parent["Right Leg"]
- local rightarm = HUMANOID.Parent["Right Arm"]
- local torso = HUMANOID.Parent.Torso
- local root =HUMANOID.Parent.HumanoidRootPart
- if removeHRP == true then
- root:Destroy()
- end
- local rootA =Instance.new("Attachment")
- local HeadA = Instance.new("Attachment")
- local LeftArmA = Instance.new("Attachment")
- local LeftLegA = Instance.new("Attachment")
- local RightArmA = Instance.new("Attachment")
- local RightLegA = Instance.new("Attachment")
- local TorsoA = Instance.new("Attachment")
- local TorsoA1 = Instance.new("Attachment")
- local TorsoA2 = Instance.new("Attachment")
- local TorsoA3 = Instance.new("Attachment")
- local TorsoA4 = Instance.new("Attachment")
- local TorsoA5 = Instance.new("Attachment")
- function set1()
- HeadA.Name = "HeadA"
- HeadA.Parent = head
- HeadA.Position = Vector3.new(0, -0.5, 0)
- HeadA.Rotation = Vector3.new(0, 0, 0)
- HeadA.Axis = Vector3.new(1, 0, 0)
- HeadA.SecondaryAxis = Vector3.new(0, 1, 0)
- LeftArmA.Name = "LeftArmA"
- LeftArmA.Parent = leftarm
- LeftArmA.Position = Vector3.new(0.5, 1, 0)
- LeftArmA.Rotation = Vector3.new(0, 0, 0)
- LeftArmA.Axis = Vector3.new(1, 0, 0)
- LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)
- LeftLegA.Name = "LeftLegA"
- LeftLegA.Parent = leftleg
- LeftLegA.Position = Vector3.new(0, 1, 0)
- LeftLegA.Rotation = Vector3.new(0, 0, 0)
- LeftLegA.Axis = Vector3.new(1, 0, 0)
- LeftLegA.SecondaryAxis = Vector3.new(0, 1, 0)
- RightArmA.Name = "RightArmA"
- RightArmA.Parent = rightarm
- RightArmA.Position = Vector3.new(-0.5, 1, 0)
- RightArmA.Rotation = Vector3.new(0, 0, 0)
- RightArmA.Axis = Vector3.new(1, 0, 0)
- RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)
- RightLegA.Name = "RightLegA"
- RightLegA.Parent = rightleg
- RightLegA.Position = Vector3.new(0, 1, 0)
- RightLegA.Rotation = Vector3.new(0, 0, 0)
- RightLegA.Axis = Vector3.new(1, 0, 0)
- RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)
- rootA.Name= "rootA"
- rootA.Parent = root
- rootA.Position = Vector3.new(0, 0, 0)
- rootA.Rotation = Vector3.new(0, 90, 0)
- rootA.Axis = Vector3.new(0, 0, -1)
- rootA.SecondaryAxis = Vector3.new(0, 1, 0)
- end
- function set2()
- TorsoA.Name = "TorsoA"
- TorsoA.Parent = torso
- TorsoA.Position = Vector3.new(0.5, -1, 0)
- TorsoA.Rotation = Vector3.new(0, 0, 0)
- TorsoA.Axis = Vector3.new(1, 0, 0)
- TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)
- TorsoA1.Name = "TorsoA1"
- TorsoA1.Parent = torso
- TorsoA1.Position = Vector3.new(-0.5, -1, 0)
- TorsoA1.Rotation = Vector3.new(0, 0, 0)
- TorsoA1.Axis = Vector3.new(1, 0, 0)
- TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)
- TorsoA2.Name = "TorsoA2"
- TorsoA2.Parent = torso
- TorsoA2.Position = Vector3.new(-1, 1, 0)
- TorsoA2.Rotation = Vector3.new(0, 0, 0)
- TorsoA2.Axis = Vector3.new(1, 0, 0)
- TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)
- TorsoA3.Name = "TorsoA3"
- TorsoA3.Parent = torso
- TorsoA3.Position = Vector3.new(1, 1, 0)
- TorsoA3.Rotation = Vector3.new(0, 0, 0)
- TorsoA3.Axis = Vector3.new(1, 0, 0)
- TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)
- TorsoA4.Name = "TorsoA4"
- TorsoA4.Parent = torso
- TorsoA4.Position = Vector3.new(0, 1, 0)
- TorsoA4.Rotation = Vector3.new(0, 0, 0)
- TorsoA4.Axis = Vector3.new(1, 0, 0)
- TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)
- TorsoA5.Name = "TorsoA5"
- TorsoA5.Parent = torso
- TorsoA5.Position = Vector3.new(0, 0, 0)
- TorsoA5.Rotation = Vector3.new(0, 90, 0)
- TorsoA5.Axis = Vector3.new(0, 0, -1)
- TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)
- end
- function set3()
- end
- spawn(set1);
- spawn(set2);
- local HA = Instance.new("HingeConstraint")
- HA.Parent = head
- HA.Attachment0 = HeadA
- HA.Attachment1 = TorsoA4
- HA.Enabled = true
- HA.LimitsEnabled=true
- HA.LowerAngle=0
- HA.UpperAngle=0
- local LAT = Instance.new("BallSocketConstraint")
- LAT.Parent = leftarm
- LAT.Attachment0 = LeftArmA
- LAT.Attachment1 = TorsoA2
- LAT.Enabled = true
- LAT.LimitsEnabled=true
- LAT.UpperAngle=90
- local RAT = Instance.new("BallSocketConstraint")
- RAT.Parent = rightarm
- RAT.Attachment0 = RightArmA
- RAT.Attachment1 = TorsoA3
- RAT.Enabled = true
- RAT.LimitsEnabled=true
- RAT.UpperAngle=90
- local HA = Instance.new("BallSocketConstraint")
- HA.Parent = head
- HA.Attachment0 = HeadA
- HA.Attachment1 = TorsoA4
- HA.Enabled = true
- local TLL = Instance.new("BallSocketConstraint")
- TLL.Parent = torso
- TLL.Attachment0 = TorsoA1
- TLL.Attachment1 = LeftLegA
- TLL.Enabled = true
- TLL.LimitsEnabled=true
- TLL.UpperAngle=90
- local TRL = Instance.new("BallSocketConstraint")
- TRL.Parent = torso
- TRL.Attachment0 = TorsoA
- TRL.Attachment1 = RightLegA
- TRL.Enabled = true
- TRL.LimitsEnabled=true
- TRL.UpperAngle=90
- local RTA = Instance.new("BallSocketConstraint")
- RTA.Parent = root
- RTA.Attachment0 = rootA
- RTA.Attachment1 = TorsoA5
- RTA.Enabled = true
- RTA.LimitsEnabled=true
- RTA.UpperAngle=0
- head.Velocity = head.CFrame.lookVector*30
- for _,child in next,script.Parent:GetChildren() do
- if child:IsA("Accoutrement") then
- for _,part in next,child:GetChildren() do
- if part:IsA("BasePart") then
- part.Parent = script.Parent
- child:remove()
- local attachment1 = part:FindFirstChildOfClass("Attachment")
- local attachment0 = getAttachment0(attachment1.Name)
- if attachment0 and attachment1 then
- local constraint = Instance.new("HingeConstraint")
- constraint.Attachment0 = attachment0
- constraint.Attachment1 = attachment1
- constraint.LimitsEnabled = true
- constraint.UpperAngle = 0
- constraint.LowerAngle = 0
- constraint.Parent = script.Parent
- end
- end
- end
- end
- end
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement