Let's say you have a WorldObject variable. This WorldObject variable represents a creature you're trying to manipulate, however, you won't be able to access the creature's methods since the variable's type is currently and strictly WorldObject. Example method that you might use this on:
:GetNearObject
To convert the variable to Creature, that is where ToCreature comes in at.
Code:
creature = WorldObject:ToCreature()
if (creature ~= nil) then -- Make sure the conversion was successful
-- Conversion Successful
-- You can now use 'creature' variable
print(creature:GetName())
end
- Moved.
Eluna Lua Engine © ->
Lua section is
FOR RELEASES ONLY. THIS IS NOT A RELEASE.
Eluna Support ->
Scripting is for SCRIPTING SUPPORT. This is the second time I had to move one of your threads.