SHOW:
|
|
- or go back to the newest paste.
1 | - | minetest.register_chatcommand("goldtouch", { |
1 | + | goldtouch = {} |
2 | goldtouch.players = {} | |
3 | ||
4 | - | local player = minetest.env:get_player_by_name(param) |
4 | + | minetest.register_chatcommand("goldtouch", { |
5 | params = "singleplayer", | |
6 | - | local playerPos = player:getpos() |
6 | + | |
7 | - | playerPos.x = math.floor(playerPos.x) |
7 | + | if not goldtouch.players[name] then |
8 | - | playerPos.y = math.floor(playerPos.y) |
8 | + | goldtouch.players[name] = true |
9 | - | playerPos.z = math.floor(playerPos.z) |
9 | + | else |
10 | - | minetest.set_node(playerPos, {name="default:goldblock"}) |
10 | + | goldtouch.players[name] = not goldtouch.players[name] |
11 | end | |
12 | end | |
13 | }) |