mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix base:drop component
This commit is contained in:
parent
0de4061253
commit
f172a45d39
1 changed files with 3 additions and 2 deletions
|
|
@ -53,10 +53,11 @@ function on_fall()
|
|||
end
|
||||
|
||||
function on_sensor_enter(index, oid)
|
||||
local playerentity = player.get_entity(hud.get_player())
|
||||
local playerid = hud.get_player()
|
||||
local playerentity = player.get_entity(playerid)
|
||||
if ready and oid == playerentity and index == 0 then
|
||||
entity:despawn()
|
||||
inventory.add(player.get_inventory(oid), dropitem.id, dropitem.count)
|
||||
inventory.add(player.get_inventory(playerid), dropitem.id, dropitem.count)
|
||||
audio.play_sound_2d("events/pickup", 0.5, 0.8+math.random()*0.4, "regular")
|
||||
end
|
||||
if index == 1 and ready and oid == playerentity then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue