Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --overrides the default swords to remove attack cooldown.
- --Some code I might use later: on_secondary_use = function(itemstack, user)
- local my_players = {}
- minetest.override_item("default:sword_diamond", {
- description = "Diamond Sword",
- inventory_image = "default_tool_diamondsword.png",
- tool_capabilities = {
- full_punch_interval = 0.1,
- max_drop_level=1,
- groupcaps={
- snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
- },
- damage_groups = {fleshy=8},
- },
- sound = {breaks = "default_tool_breaks"},
- on_secondary_use = function(itemstack, clicker, user)
- minetest.chat_send_all(math.random())
- itemstack:take_item(); return ("default:sword_mese")
- end,
- })
- minetest.override_item("default:sword_mese", {
- description = "Mese Sword",
- inventory_image = "default_tool_mesesword.png",
- tool_capabilities = {
- full_punch_interval = 0.1,
- max_drop_level=1,
- groupcaps={
- snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3},
- },
- damage_groups = {fleshy=7},
- },
- sound = {breaks = "default_tool_breaks"},
- on_place = function(itemstack, placer, pointed_thing)
- my_players[placer:get_player_name()] = true
- end
- minetest.register_globalstep(function(dtime)
- for name, what in pairs(my_players) do
- local player = minetest.get_player_by_name(name)
- if player then
- my_players[name] = false -- player left
- else
- if !player:get_player_control().RMB then
- minetest.chat_send_all(math.random())
- my_players[name] = false
- end
- end
- end
- end)
- })
- minetest.override_item("default:sword_steel", {
- description = "Steel Sword",
- inventory_image = "default_tool_steelsword.png",
- tool_capabilities = {
- full_punch_interval = 0.1,
- max_drop_level=1,
- groupcaps={
- snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
- },
- damage_groups = {fleshy=6},
- },
- sound = {breaks = "default_tool_breaks"},
- })
- minetest.override_item("default:sword_bronze", {
- description = "Bronze Sword",
- inventory_image = "default_tool_bronzesword.png",
- tool_capabilities = {
- full_punch_interval = 0.1,
- max_drop_level=1,
- groupcaps={
- snappy={times={[1]=2.75, [2]=1.30, [3]=0.375}, uses=25, maxlevel=2},
- },
- damage_groups = {fleshy=6},
- },
- sound = {breaks = "default_tool_breaks"},
- })
- minetest.override_item("default:sword_stone", {
- description = "Stone Sword",
- inventory_image = "default_tool_stonesword.png",
- tool_capabilities = {
- full_punch_interval = 0.1,
- max_drop_level=0,
- groupcaps={
- snappy={times={[2]=1.4, [3]=0.40}, uses=20, maxlevel=1},
- },
- damage_groups = {fleshy=4},
- },
- sound = {breaks = "default_tool_breaks"},
- })
- minetest.override_item("default:sword_wood", {
- description = "Wooden Sword",
- inventory_image = "default_tool_woodsword.png",
- tool_capabilities = {
- full_punch_interval = 0.1,
- max_drop_level=0,
- groupcaps={
- snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1},
- },
- damage_groups = {fleshy=2},
- },
- groups = {flammable = 2},
- sound = {breaks = "default_tool_breaks"},
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement