Again? Yep, again... More questions.

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Sat Mar 16, 2013 00:58

Never mind, I put this on hold for what we're talking about in mod requests.
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Sat Mar 16, 2013 02:48

Tedypig wrote:Where do I put what you said?


Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_tool("sits:sword_of_ultimate_power", {
description = "Sword Of Ultimate Power",
inventory_image="sword_of_ultimate_power.png",
on_use = function(stack, player, pointedThing)
         local pos = pointedThing.under
         local obj = pointedThing.ref
         if pointedThing.type == "object" and obj then
            obj:set_hp(0)
            local pName = obj:get_player_name()
            if not pName or pName == "" then
               -- Non-player entities have to be removed explicitly
               obj:remove()
            end
         elseif pointedThing.type == "node" and pos then
            minetest.node_dig(pos, minetest.env:get_node(pos), player)
         end
      end
     
   })
Last edited by prestidigitator on Sat Mar 16, 2013 02:48, edited 1 time in total.
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Sat Mar 16, 2013 16:55

OK, it works now. I would like to have continuous hitting, but I guess it's not possible. I tried adding

tool_capabilities={
full_punch_interval=0}

before the code you gave me, but it didn't work. You were right, the tool_capabilities doesn't even load.
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

Previous

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 8 guests

cron