interface case, acrylic ui, swap to make, lint
This commit is contained in:
parent
f5584a9b0c
commit
a5bc77030a
24 changed files with 353 additions and 92 deletions
|
@ -1,3 +1,4 @@
|
|||
import Make from "@rbxts/make"
|
||||
import { World, useEvent } from "@rbxts/matter"
|
||||
import { Model, PlayerCharacter } from "ReplicatedStorage/ecs/components"
|
||||
|
||||
|
@ -15,19 +16,22 @@ function playersRagdollOnDeath(world: World): void {
|
|||
for (const [_] of useEvent(playerCharacter.humanoid, "Died")) {
|
||||
model.model.GetDescendants().forEach((v, _) => {
|
||||
if (v.IsA("Motor6D")) {
|
||||
const attachment0 = new Instance("Attachment")
|
||||
const attachment1 = new Instance("Attachment")
|
||||
attachment0.CFrame = v.C0
|
||||
attachment1.CFrame = v.C1
|
||||
attachment0.Parent = v.Part0
|
||||
attachment1.Parent = v.Part1
|
||||
const attachment0 = Make("Attachment", {
|
||||
CFrame: v.C0,
|
||||
Parent: v.Part0
|
||||
})
|
||||
const attachment1 = Make("Attachment", {
|
||||
CFrame: v.C1,
|
||||
Parent: v.Part1
|
||||
})
|
||||
|
||||
const ballSocketConstraint = new Instance("BallSocketConstraint")
|
||||
ballSocketConstraint.Attachment0 = attachment0
|
||||
ballSocketConstraint.Attachment1 = attachment1
|
||||
ballSocketConstraint.LimitsEnabled = true
|
||||
ballSocketConstraint.TwistLimitsEnabled = true
|
||||
ballSocketConstraint.Parent = v.Parent
|
||||
Make("BallSocketConstraint", {
|
||||
Attachment0: attachment0,
|
||||
Attachment1: attachment1,
|
||||
LimitsEnabled: true,
|
||||
TwistLimitsEnabled: true,
|
||||
Parent: v.Parent
|
||||
})
|
||||
|
||||
v.Destroy()
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useEvent, World } from "@rbxts/matter"
|
||||
import { Players } from "@rbxts/services"
|
||||
import * as Components from "ReplicatedStorage/ecs/components"
|
||||
import { serverState } from "ReplicatedStorage/ecs/state"
|
||||
import { ServerState } from "ReplicatedStorage/ecs/state"
|
||||
import { getEvent } from "ReplicatedStorage/remotes"
|
||||
|
||||
type ComponentName = keyof typeof Components
|
||||
|
@ -21,7 +21,7 @@ const replicatedComponents: ReadonlySet<ComponentConstructor> = REPLICATED_COMPO
|
|||
|
||||
getEvent("EcsReplication")
|
||||
|
||||
function replication(world: World, server: serverState): void {
|
||||
function replication(world: World, server: ServerState): void {
|
||||
const replicationEvent = getEvent("EcsReplication")
|
||||
|
||||
let payload: Map<string, Map<ComponentName, { data?: Components.GooplerComponent }>> | undefined
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Log, { Logger } from "@rbxts/log"
|
||||
import { start } from "ReplicatedStorage/ecs"
|
||||
import { serverState } from "ReplicatedStorage/ecs/state"
|
||||
import { ServerState } from "ReplicatedStorage/ecs/state"
|
||||
import { Host } from "ReplicatedStorage/hosts"
|
||||
import { setEnvironment } from "ReplicatedStorage/idAttribute"
|
||||
import { getEvent } from "ReplicatedStorage/remotes"
|
||||
|
@ -12,7 +12,7 @@ const serverLogger = Logger.configure()
|
|||
.WriteTo(Log.RobloxOutput())
|
||||
.Create()
|
||||
|
||||
const ServerState = new serverState(
|
||||
const serverState = new ServerState(
|
||||
serverLogger
|
||||
)
|
||||
|
||||
|
@ -21,4 +21,4 @@ const ServerState = new serverState(
|
|||
getEvent("EcsReplication")
|
||||
|
||||
setEnvironment(HOST)
|
||||
start(HOST, ServerState)
|
||||
start(HOST, serverState)
|
Loading…
Add table
Add a link
Reference in a new issue