Skip to content

Commit

Permalink
Refactored code so it would actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
chrobione committed Dec 13, 2015
1 parent 4ab66e9 commit f8f2c58
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugin.lua
Expand Up @@ -12,7 +12,7 @@


function Initialize(Plugin)
Plugin:SetName("Deathdrop")
Plugin:SetName("GraveChest")
Plugin:SetVersion(.1)

--Hook into the HOOK_KILLING to see when something is going to die
Expand All @@ -30,11 +30,12 @@ function OnKilling(Victim, Killer, TDI)
--Give a lighting bolt above to let the player know their stuff is saved
Victim:GetWorld():CastThunderbolt(Victim:GetPosition().x, Victim:GetPosition().y, Victim:GetPosition().z);
--Build the chest and face no sure what ZM is yet...
Victim:GetWorld():SetBlock(PlayerPos.x,(PlayerPos.y +2) , PlayerPos.z, E_BLOCK_CHEST, E_META_CHEST_FACING_ZM)
Victim:GetWorld():SetBlock(Victim:GetPosition().x,(Victim:GetPosition().y +2) , Victim:GetPosition().z, E_BLOCK_CHEST, E_META_CHEST_FACING_ZM)
--get the players items and copy them to a chest
local Items = cItems()
Victim:GetInventory():CopyToItems(Items)
Victim:GetWorld():DoWithChestAt(PlayerPos.x,(PlayerPos.y +2) , PlayerPos.z,
local TESTVAR = Victim:GetInventory()
TESTVAR:CopyToItems(Items)
Victim:GetWorld():DoWithChestAt(Victim:GetPosition().x, (Victim:GetPosition().y +2), Victim:GetPosition().z,
function(a_Chest)
a_Chest:GetContents():AddItems(Items)
end)
Expand Down

0 comments on commit f8f2c58

Please sign in to comment.