06-20-2014, 04:30 AM
Hey,
I am messing arount with your software as it seems pretty nice and powerful.
But I have one problem: How do I convert an entity from the hook to a player?
In Java I get an Entity object from the Event (PlayerInteractEntityEvent in this case).
And then I can convert that to a Player: (Player)event.getEntity()
How do I do that in Lua?
Sorry for my nooby questions, but I am new to Lua and MCServer :)
I am messing arount with your software as it seems pretty nice and powerful.
But I have one problem: How do I convert an entity from the hook to a player?
In Java I get an Entity object from the Event (PlayerInteractEntityEvent in this case).
And then I can convert that to a Player: (Player)event.getEntity()
How do I do that in Lua?
Code:
function PlayerInteract(Player, Entity)
if Entity:GetEntityType() == cEntity.etPlayer and Player:GetInventory():GetEquippedItem().m_ItemType == 369 then
Player:SendMessage("§a" .. "..Name of Entity")
end
end
Sorry for my nooby questions, but I am new to Lua and MCServer :)