update ragdoll, add todo

This commit is contained in:
Reid 2023-08-12 03:20:20 -07:00
parent a8b217d45e
commit 6b985497ba
4 changed files with 11 additions and 6 deletions

View file

@ -21,14 +21,12 @@ function sprint(_: World, client: clientState): void {
})
}
if (client.isRunning && client.character) {
if (client.isRunning) {
client.character.Humanoid.WalkSpeed = 24
return
}
if (client.character) {
client.character.Humanoid.WalkSpeed = 16
}
client.character.Humanoid.WalkSpeed = 16
}
export = sprint

View file

@ -14,6 +14,8 @@ function playersArePlayerCharacters(world: World): void {
model: character
}),
PlayerCharacter({
// I know this is kinda dumb, "why not the model component!!!"
// The model component doesnt retain types
character: character as CharacterRigR6,
player: Players.GetPlayerFromCharacter(character) as Player,
humanoid: character.WaitForChild("Humanoid") as Humanoid

View file

@ -8,7 +8,7 @@ import { Model, PlayerCharacter } from "ReplicatedStorage/ecs/components"
*/
function playersRagdollOnDeath(world: World): void {
for (const [_, playerCharacter, model] of world.query(PlayerCharacter, Model)) {
if (!model.model) continue
if (!model.model || !playerCharacter.character) continue
playerCharacter.humanoid.BreakJointsOnDeath = false
@ -32,6 +32,9 @@ function playersRagdollOnDeath(world: World): void {
v.Destroy()
}
})
// Makes it so their head doesn't just dangle
playerCharacter.character.HumanoidRootPart.ApplyImpulse(Vector3.FromNormalId(Enum.NormalId.Back).mul(100))
}
}