On_EntityDeployed

Mar 22, 2016
On_EntityDeployed
  • Method:
    On_EntityDeployed

    Argument(s):
    1: Fougerite.Player Player (First Placer, which is the owner, can be null if offline)
    2: Entity e
    3: Fougerite.Player ActualPlacer (The Player who actually places the object)

    Examples:
    Python:

    Code (Python):
    def On_EntityDeployed(self, Player, Entity, ActualPlacer):
        if Entity.Name == "WoodPillar":
            Entity.Destroy()
            ActualPlacer.Inventory.AddItem("Wood Pillar")
            ActualPlacer.InventoryNotice("1 x Wood Pillar")
            ActualPlacer.Message("You are not allowed to place pillars on this server!")
     

    Javascript:
    Code (Javascript):
    function On_EntityDeployed(Player, Entity, ActualPlacer) {
        if (Entity.Name == "WoodPillar") {
            Entity.Destroy();
            ActualPlacer.Inventory.AddItem("Wood Pillar");
            ActualPlacer.InventoryNotice("1 x Wood Pillar");
            ActualPlacer.Message("You are not allowed to place pillars on this server!");
        }
    }
    Lua:
    Code (Lua):
    function On_EntityDeployed(Player, Entity, ActualPlacer)
        if (Entity.Name == "WoodPillar") then
            Entity.Destroy()
            ActualPlacer.Inventory:AddItem("Wood Pillar")
            ActualPlacer:InventoryNotice("1 x Wood Pillar")
            ActualPlacer:Message("You are not allowed to place pillars on this server!")
        end
    end
    C#:
    Code (C#):
    ...