Yue Posted August 18 Posted August 18 if type(entity.healthmanager) == "table" then if type(entity.healthmanager.TakeDamage) == "function" then entity.healthmanager:TakeDamage(10) end end This doesn't work for me; it's in the documentation. My Code. local box = world:FindBrush("Box") box:SetColor(1, 0, 0, 1) box:SetRotation(0, 45, 0) -- Rotación inicial Print("XXXXX") if type(box.GUI) == "table" then if type(box.GUI.MostrarMensaje) == "function" then box.GUI:MostrarMensaje() -- Not call Method. end end The method for recovering the component, if it works. local comp = box:GetComponent("GUI") if comp then -- Leer/escribir miembros y llamar métodos públicos del componente Print(comp.n) comp:MostrarMensaje() end Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Josh Posted August 18 Posted August 18 The components had to be changed to an array-style table, in order to retain the order of execution. What page in the documentation does this occur on? 1 Quote Let's build cool stuff and have fun.
Yue Posted August 18 Author Posted August 18 Here: https://www.leadwerks.com/learn/Component?lang=lua Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Josh Posted August 25 Posted August 25 I need to determine how I am handling the Lua API before I proceed with this. Quote Let's build cool stuff and have fun.
Solution Josh Posted September 2 Solution Posted September 2 This page is no longer needed in the Lua documentation and will be removed. 1 Quote Let's build cool stuff and have fun.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.