mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +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
|
end
|
||||||
|
|
||||||
function on_sensor_enter(index, oid)
|
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
|
if ready and oid == playerentity and index == 0 then
|
||||||
entity:despawn()
|
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")
|
audio.play_sound_2d("events/pickup", 0.5, 0.8+math.random()*0.4, "regular")
|
||||||
end
|
end
|
||||||
if index == 1 and ready and oid == playerentity then
|
if index == 1 and ready and oid == playerentity then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue