fix resetting, add comments
This commit is contained in:
parent
e7acbd72fa
commit
a8b217d45e
6 changed files with 46 additions and 4 deletions
18
src/ReplicatedStorage/ecs/systems/client/customReset.ts
Normal file
18
src/ReplicatedStorage/ecs/systems/client/customReset.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { World, useEvent } from "@rbxts/matter"
|
||||
import { StarterGui } from "@rbxts/services"
|
||||
import { clientState } from "ReplicatedStorage/ecs/state"
|
||||
import { getEvent } from "ReplicatedStorage/remotes"
|
||||
|
||||
const resetButtonCallback = new Instance("BindableEvent")
|
||||
StarterGui.SetCore("ResetButtonCallback", resetButtonCallback)
|
||||
|
||||
getEvent("resetButton")
|
||||
|
||||
function customReset(_: World, _client: clientState): void {
|
||||
const resetButtonEvent = getEvent("resetButton")
|
||||
for (const [,] of useEvent(resetButtonCallback, "Event")) {
|
||||
resetButtonEvent.FireServer()
|
||||
}
|
||||
}
|
||||
|
||||
export = customReset
|
Loading…
Add table
Add a link
Reference in a new issue