mirror of
https://github.com/Ukendio/jecs.git
synced 2025-08-04 11:19:17 +00:00
12 lines
392 B
Text
Executable file
12 lines
392 B
Text
Executable file
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|
local ct = require(ReplicatedStorage.components)
|
|
return function(world, dt)
|
|
for e, poison, health in world:query(ct.Poison, ct.Health) do
|
|
local health_after_tick = health - poison * dt * 0.05
|
|
if health_after_tick < 0 then
|
|
world:remove(e, ct.Health)
|
|
continue
|
|
end
|
|
world:set(e, ct.Health, health_after_tick)
|
|
end
|
|
end
|