Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()--shoulda used this
- local function Ragdoll()--Ragdoll the player
- for _, v in pairs(Char:GetDescendants()) do --Char = player.Character
- if v:IsA("Motor6D") then
- local Att0, Att1 = Instance.new("Attachment"), Instance.new("Attachment")
- Att0.CFrame = v.C0
- Att1.CFrame = v.C1
- Att0.Parent = v.Part0
- Att0.Name = "Att0"
- Att1.Name = "Att1"
- Att1.Parent = v.Part1
- local BSC = Instance.new("BallSocketConstraint")
- BSC.Attachment0 = Att0
- BSC.Attachment1 = Att1
- BSC.Parent = v.Part0
- BSC.LimitsEnabled = true
- BSC.MaxFrictionTorque = 50
- BSC.TwistLimitsEnabled = true
- BSC.UpperAngle = 90
- BSC.TwistLowerAngle = -90
- BSC.TwistUpperAngle = 90
- BSC.Name = "BSC"--bbc lmao
- v.Enabled = false
- end
- end
- --Char.HumanoidRootPart.CanCollide = true
- end
- local function Unragdoll()--Unragdoll the player
- for _, v in pairs(Char:GetDescendants()) do
- if v:IsA("Motor6D") then
- local Att0 = v.Part0:FindFirstChild("Att0")
- local Att1 = v.Part1:FindFirstChild("Att1")
- local BSC = v.Part0:FindFirstChild("BSC")
- Att0:Destroy()--Remove all constraints
- Att1:Destroy()
- BSC:Destroy()
- v.Enabled = true--make this efficient by enabling and disable Motor6ds
- end
- end
- --Char.HumanoidRootPart.CanCollide = true
- end
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()--idk why I have to char values i shoulda used the old one lol
- local function checkProximity(explosion)--the part where it actually checks the explosions
- local explosionPosition = explosion.Position--check for pos
- local characterPosition = character.HumanoidRootPart.Position--check for char pos
- local distance = (explosionPosition - characterPosition).Magnitude--dist value
- if distance <= explosion.BlastRadius then--detect
- character.Humanoid.Health -= 15--dmg value of explosions
- Ragdoll()
- character.Humanoid.PlatformStand = true
- task.wait(3)--this number is basically how long you want the player to be ragdolled
- character.Humanoid.PlatformStand = false
- Unragdoll()
- end
- end
- game.DescendantAdded:Connect(function(descendant)
- if descendant:IsA("Explosion") then
- checkProximity(descendant)--check for hot explosions nearby
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment