@rbxts/falldown 1.1.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/index.d.ts +4 -0
- package/out/init.luau +37 -7
- package/package.json +1 -1
package/out/index.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ export interface IActiveRagdoll {
|
|
|
47
47
|
* @see {@linkcode Falldown.VelocityMode}
|
|
48
48
|
*/
|
|
49
49
|
export declare class Falldown {
|
|
50
|
+
/**
|
|
51
|
+
* If `true`, players will have DevEnableMouseLock set to `false` when ragdolled, preventing shift-lock mode. This is necessary to avoid camera issues while ragdolled, but may affect player preference for shift-lock. Defaults to `true`.
|
|
52
|
+
*/
|
|
53
|
+
static DisableShiftLockOnRagdoll: boolean;
|
|
50
54
|
/**
|
|
51
55
|
* Enum used to represent how velocity should be distributed across a ragdolled character's body parts.
|
|
52
56
|
* @static
|
package/out/init.luau
CHANGED
|
@@ -377,6 +377,14 @@ do
|
|
|
377
377
|
function ActiveRagdoll:constructor(character, objectiveHeight, standFadeTime, humanoid, humanoidRootPart, leftTouchObj, rightTouchObj, jointDestructionInfo, bodypartGroupId, automaticDuration, exitMode, getupFront, getupBack)
|
|
378
378
|
self.Destroyed = Signal.new()
|
|
379
379
|
self.Ended = Signal.new()
|
|
380
|
+
self.EndTime = nil
|
|
381
|
+
if Falldown.DisableShiftLockOnRagdoll then
|
|
382
|
+
local player = Players:GetPlayerFromCharacter(character)
|
|
383
|
+
if player then
|
|
384
|
+
self._wasShiftLockEnabled = player.DevEnableMouseLock
|
|
385
|
+
player.DevEnableMouseLock = false
|
|
386
|
+
end
|
|
387
|
+
end
|
|
380
388
|
character.Destroying:Once(function()
|
|
381
389
|
self.CharacterDead = true
|
|
382
390
|
table.clear(self._jointDestructionInfo)
|
|
@@ -414,13 +422,22 @@ do
|
|
|
414
422
|
_condition = not self.CharacterDead
|
|
415
423
|
end
|
|
416
424
|
if _condition ~= 0 and _condition == _condition and _condition then
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
425
|
+
self.EndTime = DateTime.now().UnixTimestampMillis + (self._automaticDuration * 1000)
|
|
426
|
+
self._durationListener = RunService.Heartbeat:Connect(function()
|
|
427
|
+
if self.EndTime == nil then
|
|
428
|
+
self._durationListener:Disconnect()
|
|
429
|
+
return nil
|
|
430
|
+
end
|
|
431
|
+
if DateTime.now().UnixTimestampMillis >= self.EndTime then
|
|
432
|
+
self.EndTime = nil
|
|
433
|
+
local _self = self
|
|
434
|
+
local _condition_1 = exitMode
|
|
435
|
+
if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1) then
|
|
436
|
+
_condition_1 = Falldown.ExitMode.Smooth
|
|
437
|
+
end
|
|
438
|
+
_self:Destroy(_condition_1)
|
|
439
|
+
self._durationListener:Disconnect()
|
|
422
440
|
end
|
|
423
|
-
_self:Destroy(_condition_1)
|
|
424
441
|
end)
|
|
425
442
|
end
|
|
426
443
|
end
|
|
@@ -496,6 +513,7 @@ do
|
|
|
496
513
|
end
|
|
497
514
|
end
|
|
498
515
|
function ActiveRagdoll:Destroy(exitMode, overrideDeathLock)
|
|
516
|
+
self.EndTime = nil
|
|
499
517
|
if self.Character.Parent == nil then
|
|
500
518
|
return nil
|
|
501
519
|
end
|
|
@@ -832,6 +850,9 @@ do
|
|
|
832
850
|
clonedCharacter:Destroy()
|
|
833
851
|
end)
|
|
834
852
|
end
|
|
853
|
+
if self._wasShiftLockEnabled ~= nil and self.Owner then
|
|
854
|
+
self.Owner.DevEnableMouseLock = self._wasShiftLockEnabled
|
|
855
|
+
end
|
|
835
856
|
PhysicsService:UnregisterCollisionGroup(self._bodypartGroupId)
|
|
836
857
|
self.Destroyed:Fire()
|
|
837
858
|
self.Destroyed:Destroy()
|
|
@@ -1529,7 +1550,15 @@ do
|
|
|
1529
1550
|
function Falldown:RagdollCharacter(character, standupFadeTime, automaticDuration, exitMode, getupFront, getupBack)
|
|
1530
1551
|
local __activeRagdolls = self._activeRagdolls
|
|
1531
1552
|
local _character = character
|
|
1532
|
-
|
|
1553
|
+
local existing = __activeRagdolls[_character]
|
|
1554
|
+
if existing then
|
|
1555
|
+
if existing.EndTime ~= nil then
|
|
1556
|
+
if automaticDuration ~= nil then
|
|
1557
|
+
existing.EndTime = DateTime.now().UnixTimestampMillis + (automaticDuration * 1000)
|
|
1558
|
+
else
|
|
1559
|
+
existing.EndTime = nil
|
|
1560
|
+
end
|
|
1561
|
+
end
|
|
1533
1562
|
return nil
|
|
1534
1563
|
end
|
|
1535
1564
|
local humanoid = character:FindFirstChildOfClass("Humanoid")
|
|
@@ -1644,6 +1673,7 @@ do
|
|
|
1644
1673
|
end
|
|
1645
1674
|
end
|
|
1646
1675
|
end
|
|
1676
|
+
Falldown.DisableShiftLockOnRagdoll = true
|
|
1647
1677
|
Falldown.VelocityMode = {
|
|
1648
1678
|
RootOnly = 0,
|
|
1649
1679
|
AllEqual = 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/falldown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A realistic ragdoll physics system for Roblox with smooth getup animations, collision management, and customizable velocity modes. Supports both R6 and R15 rigs with surface-aware positioning.",
|
|
5
5
|
"main": "out/init.luau",
|
|
6
6
|
"scripts": {
|