From 2337434fac0359677a3c4945593e293761395ed9 Mon Sep 17 00:00:00 2001 From: silly-spongus <159207316+silly-spongus@users.noreply.github.com> Date: Sun, 29 Sep 2024 04:04:46 -0300 Subject: [PATCH] Update world.md --- docs/api/world.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/api/world.md b/docs/api/world.md index 93f3326..d727d2f 100644 --- a/docs/api/world.md +++ b/docs/api/world.md @@ -81,10 +81,7 @@ local Health = world:component() :: jecs.Entity local Entity = world:entity() world:set(Entity, Health, 100) -local EntityWithNoHealth = world:entity() - print(world:get(Entity, Health)) -- Outputs 100 -print(world:get(EntityWithNoHealth, Health)) -- Outputs nil ``` ```ts [typescript] @@ -93,10 +90,7 @@ const Health = world.component(); const Entity = world.entity(); world.set(Entity, Health, 100); -const EntityWithNoHealth = world.entity(); - print(world.get(Entity, Health)) // Outputs 100 -print(world.get(EntityWithNoHealth, Health)) // Outputs undefined (nil) ``` ::: @@ -114,7 +108,7 @@ Example: ::: code-group ```luau [luau] local IsMoving = world:component() -local Ragdolled = world:component() -- This is a tag, meaning it won't contain data +local Ragdolled = world:entity() -- This is a tag, meaning it won't contain data local Health = world:component() :: jecs.Entity local Entity = world:entity() @@ -130,7 +124,7 @@ print(world:has(Entity, Ragdolled)) -- Outputs true ```ts [typescript] const IsMoving = world.component(); -const Ragdolled = world.component(); -- This is a tag, meaning it won't contain data +const Ragdolled = world.entity(); -- This is a tag, meaning it won't contain data const Health = world.component(); const Entity = world.entity();