This commit is contained in:
FerrDev 2026-05-26 14:55:15 +02:00
parent 05c424e6c1
commit 519f7966b7

View File

@ -9,14 +9,13 @@ local rBotUtils = require(rUtils.sharedBotUtils)
local rData = ReplicatedStorage.Data local rData = ReplicatedStorage.Data
local rWeaponData = require(rData.WeaponData) local rWeaponData = require(rData.WeaponData)
local Component = script.Parent.Component local Component = script.Parent.Component
local HitboxComponent = require(Component.HitboxComponent) local HitboxComponent = require(Component.HitboxComponent)
local ProjectileComponent = require(Component.ProjectileComponent) local ProjectileComponent = require(Component.ProjectileComponent)
local HealthComponent = require(Component.HealthComponent) local HealthComponent = require(Component.HealthComponent)
local DestroyableComponent = require(Component.DestroyableComponent) local DestroyableComponent = require(Component.DestroyableComponent)
local Janitor = require(ReplicatedStorage:WaitForChild("Janitor")) local Janitor = require(workspace:WaitForChild("Janitor"))
GameObject.__index = GameObject GameObject.__index = GameObject
@ -33,17 +32,15 @@ type self = {
Projectile: ProjectileComponent.ProjectileComponent, Projectile: ProjectileComponent.ProjectileComponent,
Hitbox: HitboxComponent.HitboxComponent, Hitbox: HitboxComponent.HitboxComponent,
Health: HealthComponent.HealthComponent, Health: HealthComponent.HealthComponent,
Destroyable : DestroyableComponent.DestroyableComponent Destroyable: DestroyableComponent.DestroyableComponent,
}, },
timepassed: number, timepassed: number,
tickspassed: number, tickspassed: number,
} }
--GameObject(TurnEnd, TurnStart, OnDestroy, Tick) Anything that needs this is a gameobject --GameObject(TurnEnd, TurnStart, OnDestroy, Tick) Anything that needs this is a gameobject
export type GameObject = typeof(setmetatable({} :: self, GameObject)) export type GameObject = typeof(setmetatable({} :: self, GameObject))
function GameObject.new(key: string?, model: Model, userId: number?, active) function GameObject.new(key: string?, model: Model, userId: number?, active)
@ -126,7 +123,6 @@ function GameObject:_Destroy()
self.Janitor:Destroy() self.Janitor:Destroy()
ObjectManager._Free(self.key) ObjectManager._Free(self.key)
end) end)
end end
----------------------------------------- -----------------------------------------
@ -146,28 +142,20 @@ end
function GameObject:OnHit() function GameObject:OnHit()
local self = self :: GameObject local self = self :: GameObject
end end
function GameObject:OnTurnEnd() function GameObject:OnTurnEnd()
local self = self :: GameObject local self = self :: GameObject
end end
function GameObject:Tick(dt) function GameObject:Tick(dt) end
end
function GameObject:OnCreate() function GameObject:OnCreate()
local self = self :: GameObject local self = self :: GameObject
end end
--Before Destroying --Before Destroying
function GameObject:BeforeDestroy() function GameObject:BeforeDestroy()
local self = self :: GameObject local self = self :: GameObject
end end
return GameObject return GameObject