Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- check a solution placed by player (checker node at pos) and give prizes if correct
- local function check_solution(pos, player)
- local meta = minetest.get_meta(pos)
- local sol = meta:get_string('solution')
- if node_is_spec_digit({x=pos.x, y=pos.y+1, z=pos.z}, sol) then
- if meta:get_string('b_saytext') == 'true' then
- minetest.chat_send_player(player:get_player_name(), meta:get_string('s_saytext'))
- end
- if meta:get_string('b_dispense') == 'true' then
- minetest.add_item({x=pos.x, y=pos.y+2, z=pos.z}, meta:get_inventory():get_list('dispense')[1])
- end
- -- make solution node indestructible by students
- minetest.set_node({x=pos.x, y=pos.y, z=pos.z}, {name="teaching:lab"})
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement