From 50fe652001ff62a35f7358391c5780828a97ae85 Mon Sep 17 00:00:00 2001 From: reidlab Date: Tue, 25 Jul 2023 01:59:21 -0700 Subject: [PATCH] add player to state --- src/ReplicatedStorage/ecs/state.ts | 2 ++ src/StarterPlayer/StarterPlayerScripts/main.client.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/ReplicatedStorage/ecs/state.ts b/src/ReplicatedStorage/ecs/state.ts index 4d480e4..625362e 100644 --- a/src/ReplicatedStorage/ecs/state.ts +++ b/src/ReplicatedStorage/ecs/state.ts @@ -7,7 +7,9 @@ import { InputKind } from "ReplicatedStorage/inputKind" * The client ECS state. */ export class clientState { + [index: string]: unknown character?: CharacterRigR6 + player?: Player debugEnabled = false isRunning = false lastProcessedCommand?: InputKind diff --git a/src/StarterPlayer/StarterPlayerScripts/main.client.ts b/src/StarterPlayer/StarterPlayerScripts/main.client.ts index a2f158f..36dc015 100644 --- a/src/StarterPlayer/StarterPlayerScripts/main.client.ts +++ b/src/StarterPlayer/StarterPlayerScripts/main.client.ts @@ -11,6 +11,7 @@ const ClientState = new clientState() const player = Players.LocalPlayer ClientState.character = (player.Character || player.CharacterAdded.Wait()[0]) as CharacterRigR6 +ClientState.player = player setEnvironment(HOST) start(HOST, ClientState) \ No newline at end of file