idk
This commit is contained in:
parent
05c424e6c1
commit
519f7966b7
@ -9,45 +9,42 @@ local rBotUtils = require(rUtils.sharedBotUtils)
|
||||
local rData = ReplicatedStorage.Data
|
||||
local rWeaponData = require(rData.WeaponData)
|
||||
|
||||
|
||||
local Component = script.Parent.Component
|
||||
local HitboxComponent = require(Component.HitboxComponent)
|
||||
local ProjectileComponent = require(Component.ProjectileComponent)
|
||||
local HealthComponent = require(Component.HealthComponent)
|
||||
local DestroyableComponent = require(Component.DestroyableComponent)
|
||||
|
||||
local Janitor = require(ReplicatedStorage:WaitForChild("Janitor"))
|
||||
local Janitor = require(workspace:WaitForChild("Janitor"))
|
||||
|
||||
GameObject.__index = GameObject
|
||||
|
||||
type self = {
|
||||
key : string,
|
||||
owner : number?,
|
||||
model : Model?,
|
||||
type : string,
|
||||
active : boolean,
|
||||
key: string,
|
||||
owner: number?,
|
||||
model: Model?,
|
||||
type: string,
|
||||
active: boolean,
|
||||
|
||||
Janitor : typeof(Janitor.new()),
|
||||
Janitor: typeof(Janitor.new()),
|
||||
|
||||
Components : {
|
||||
Projectile : ProjectileComponent.ProjectileComponent,
|
||||
Hitbox : HitboxComponent.HitboxComponent,
|
||||
Health : HealthComponent.HealthComponent,
|
||||
Destroyable : DestroyableComponent.DestroyableComponent
|
||||
Components: {
|
||||
Projectile: ProjectileComponent.ProjectileComponent,
|
||||
Hitbox: HitboxComponent.HitboxComponent,
|
||||
Health: HealthComponent.HealthComponent,
|
||||
Destroyable: DestroyableComponent.DestroyableComponent,
|
||||
},
|
||||
|
||||
timepassed : number,
|
||||
tickspassed : number,
|
||||
|
||||
timepassed: number,
|
||||
tickspassed: number,
|
||||
}
|
||||
|
||||
--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)
|
||||
local self = setmetatable({} :: self,GameObject)
|
||||
function GameObject.new(key: string?, model: Model, userId: number?, active)
|
||||
local self = setmetatable({} :: self, GameObject)
|
||||
|
||||
key = key or HttpServ:GenerateGUID(false)
|
||||
print(key)
|
||||
@ -67,7 +64,7 @@ end
|
||||
-- DONT OVERWRITE THESE
|
||||
function GameObject:_Init()
|
||||
if self.model then
|
||||
self.model:SetAttribute("key",self.key)
|
||||
self.model:SetAttribute("key", self.key)
|
||||
end
|
||||
|
||||
self:_ResetMass()
|
||||
@ -78,7 +75,7 @@ end
|
||||
|
||||
-- DONT OVERWRITE THESE
|
||||
function GameObject:_Store()
|
||||
ObjectManager.Store(self.key,self)
|
||||
ObjectManager.Store(self.key, self)
|
||||
end
|
||||
|
||||
-- DONT OVERWRITE THESE
|
||||
@ -93,7 +90,7 @@ function GameObject:_ResetMass()
|
||||
local self = self :: GameObject
|
||||
if self.model then
|
||||
local primaryPart = self.model.PrimaryPart
|
||||
for i,v in pairs(self.model:GetDescendants()) do
|
||||
for i, v in pairs(self.model:GetDescendants()) do
|
||||
if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
|
||||
if primaryPart == v or v.Parent.Name == "Hitbox" then
|
||||
continue
|
||||
@ -126,7 +123,6 @@ function GameObject:_Destroy()
|
||||
self.Janitor:Destroy()
|
||||
ObjectManager._Free(self.key)
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
@ -140,34 +136,26 @@ function GameObject:ShouldEnd()
|
||||
end
|
||||
end
|
||||
|
||||
function GameObject:GetWeaponData(name) : rWeaponData.WeaponData
|
||||
function GameObject:GetWeaponData(name): rWeaponData.WeaponData
|
||||
return rWeaponData[name]
|
||||
end
|
||||
|
||||
function GameObject:OnHit()
|
||||
local self = self :: GameObject
|
||||
|
||||
end
|
||||
|
||||
function GameObject:OnTurnEnd()
|
||||
local self = self :: GameObject
|
||||
|
||||
end
|
||||
|
||||
function GameObject:Tick(dt)
|
||||
|
||||
end
|
||||
function GameObject:Tick(dt) end
|
||||
|
||||
function GameObject:OnCreate()
|
||||
local self = self :: GameObject
|
||||
|
||||
end
|
||||
--Before Destroying
|
||||
function GameObject:BeforeDestroy()
|
||||
local self = self :: GameObject
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
return GameObject
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user