Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OWOP.tool.addToolObject(new OWOP.tool.class('(TF)Grid', OWOP.cursors.erase, OWOP.fx.player.RECT_SELECT_ALIGNED(2), false, function(tool) {
- tool.setEvent('mousemove mousedown', function(mouse, event) {
- var color = mouse.buttons == 1 ? OWOP.player.selectedColor : [255, 255, 255];
- function setChunk() {
- chunkx = Math.floor(mouse.tileX / 3) * 3
- chunky = Math.floor(mouse.tileY / 3) * 3
- for (var x = 0; x < 2; x++) {
- for (var y = 0; y < 2; y++) {
- OWOP.world.setPixel(chunkx + x + x, chunky + y + y, color)
- }
- }
- }
- switch (mouse.buttons) {
- case 1:
- setChunk()
- break;
- case 2:
- setChunk()
- break;
- }
- });
- }));
- //haha code go brrrrrrrrrrrrrrrrrrrrrrrrr - TF 2021
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement