Advertisement
chatnotags3

Scripts

Feb 7th, 2025
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.90 KB | Software | 0 0
  1. ---------------------------------------------------------------------------------------
  2. Script
  3.  
  4. local mps = game:GetService("MarketplaceService")
  5. local productid = 2837814560
  6. local launchForce = 300
  7.  
  8. local db = {}
  9.  
  10. game.Players.PlayerAdded:Connect(function(plr)
  11.     plr.CharacterAdded:Connect(function(chr)
  12.         local ragdoll = Instance.new("BoolValue", chr)
  13.         ragdoll.Name = "Ragdoll"
  14.     end)
  15. end)
  16.  
  17. local function ragdollCharacter(character)
  18.     local disabledMotors = {}
  19.     local humanoid = character:FindFirstChildOfClass("Humanoid")
  20.     if not humanoid then return end
  21.  
  22.     local originalWalkSpeed = humanoid.WalkSpeed
  23.     local originalJumpPower = humanoid.JumpPower
  24.     humanoid.WalkSpeed = 0
  25.     humanoid.JumpPower = 0
  26.  
  27.     for _, part in pairs(character:GetDescendants()) do
  28.         if part:IsA("Motor6D") then
  29.             table.insert(disabledMotors, part)
  30.             local attachment = Instance.new("Attachment")
  31.             attachment.CFrame = part.C0
  32.             attachment.Parent = part.Part0
  33.  
  34.             local constraint = Instance.new("BallSocketConstraint")
  35.             constraint.Attachment0 = attachment
  36.             constraint.Attachment1 = Instance.new("Attachment", part.Part1)
  37.             constraint.Parent = part.Part0
  38.  
  39.             part.Enabled = false
  40.         end
  41.     end
  42.  
  43.     task.delay(3, function()
  44.         if humanoid then
  45.             humanoid.WalkSpeed = originalWalkSpeed
  46.             humanoid.JumpPower = originalJumpPower
  47.         end
  48.         for _, motor in ipairs(disabledMotors) do
  49.             motor.Enabled = true
  50.         end
  51.     end)
  52. end
  53.  
  54. local function launchPlayer(player)
  55.     local character = player.Character
  56.     if character and character:FindFirstChild("HumanoidRootPart") then
  57.         local rootPart = character.HumanoidRootPart
  58.         local bodyVelocity = Instance.new("BodyVelocity")
  59.         bodyVelocity.MaxForce = Vector3.new(0, math.huge, 0)
  60.         bodyVelocity.Velocity = Vector3.new(0, launchForce, 0)
  61.         bodyVelocity.P = 1250
  62.         bodyVelocity.Parent = rootPart
  63.         game:GetService("Debris"):AddItem(bodyVelocity, 0.1)
  64.         ragdollCharacter(character)
  65.     end
  66. end
  67.  
  68. mps.PromptProductPurchaseFinished:Connect(function(userid, id, purchased)
  69.     if id == productid and purchased then
  70.         local ragdollModule = require(game:GetService("ServerScriptService").Script:FindFirstChild("Ragdoll"))
  71.         if not ragdollModule then return end
  72.  
  73.         for _, v in pairs(game.Players:GetPlayers()) do
  74.             local character = v.Character
  75.             if character and not table.find(db, character) then
  76.                 local humanoid = character:FindFirstChildOfClass("Humanoid")
  77.                 local hrp = character:FindFirstChild("HumanoidRootPart")
  78.  
  79.                 if humanoid and hrp then
  80.                     table.insert(db, character)
  81.  
  82.                     local knockbackForce = Vector3.new(math.random(-5, 5), launchForce, math.random(-5, 5))
  83.  
  84.                     local bodyVelocity = Instance.new("BodyVelocity")
  85.                     bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  86.                     bodyVelocity.Velocity = knockbackForce
  87.                     bodyVelocity.P = 1250
  88.                     bodyVelocity.Parent = hrp
  89.                     game:GetService("Debris"):AddItem(bodyVelocity, 0.1)
  90.  
  91.                     ragdollModule.Start(character)
  92.  
  93.                     task.wait(3)
  94.  
  95.                     ragdollModule.Stop(character)
  96.                     table.remove(db, table.find(db, character))
  97.                 end
  98.             end
  99.         end
  100.     end
  101. end)
  102. ---------------------------------------------------------------------------------------
  103. Ragdoll
  104.  
  105. local ragdoll = {}
  106.  
  107. function ragdoll.Start(character)
  108.     if character.Ragdoll.Value then return end
  109.     character.Ragdoll.Value = true
  110.     for i, joint in pairs(character:GetDescendants()) do
  111.         if joint:IsA("Motor6D") then
  112.             local socket = Instance.new("BallSocketConstraint")
  113.             local a0 = Instance.new("Attachment")
  114.             local a1 = Instance.new("Attachment")
  115.             a0.Parent = joint.Part0
  116.             a1.Parent = joint.Part1
  117.             socket.Parent = joint.Parent
  118.             socket.Attachment0 = a0
  119.             socket.Attachment1 = a1
  120.             a0.CFrame = joint.C0
  121.             a1.CFrame = joint.C1
  122.             socket.LimitsEnabled = true
  123.             socket.TwistLimitsEnabled = true
  124.  
  125.             joint.Enabled = false
  126.         end
  127.     end
  128.  
  129.     character.Humanoid.WalkSpeed = 0
  130.     character.Humanoid.JumpPower = 0
  131.  
  132.     character.Humanoid.PlatformStand = true
  133.  
  134.     character.Humanoid.AutoRotate = false
  135. end
  136.  
  137. function ragdoll.Stop(character)
  138.     local hrp = character:FindFirstChild("HumanoidRootPart")
  139.     local hum = character:FindFirstChild("Humanoid")
  140.  
  141.     hum.PlatformStand = false
  142.  
  143.     for i, joint in pairs(character:GetDescendants()) do
  144.         if joint:IsA("BallSocketConstraint") then
  145.             joint:Destroy()
  146.         end
  147.  
  148.         if joint:IsA("Motor6D") then
  149.             joint.Enabled = true
  150.         end
  151.     end
  152.  
  153.     character.Ragdoll.Value = false
  154.  
  155.     hum:ChangeState(Enum.HumanoidStateType.GettingUp)
  156.  
  157.     hum.WalkSpeed = 16
  158.     hum.JumpPower = 50
  159.  
  160.     hum.AutoRotate = true
  161. end
  162.  
  163. return ragdoll
  164.  
  165. ---------------------------------------------------------------------------------------
  166. Local Script
  167.  
  168. local id = 2837814560
  169. local mps = game:GetService("MarketplaceService")
  170. script.Parent.MouseButton1Click:Connect(function()
  171.     mps:PromptProductPurchase(game.Players.LocalPlayer, id)
  172. end)
  173.  
  174. ---------------------------------------------------------------------------------------
  175.  
  176.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement