Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)azekill_DIABLO wrote:i'm actually doing a mod:
on_rightclick = function(self, clicker)
-- talk to the player
minetest.chat_send('BLABLABLAblaBLObla');
-- by right-clicking owner can switch Mob between follow and stand
if self.owner and self.owner == clicker:get_player_name() then
if self.order == "follow" then
self.order = "stand"
else
self.order = "follow"
end
end
end,})
i have problems with the underlined part?
local_chat(clicker:getpos(),"Sam: Let's go kick some Mob butt!",3)
--Reese chat
local_chat = function(pos,text,radius)
if radius == nil then
radius = 25
end
if pos ~= nil then
local oir = minetest.get_objects_inside_radius(pos, radius)
for _,p in pairs(oir) do
if p:is_player() then
minetest.chat_send_player(p:get_player_name(),text)
end
end
end
end
2016-04-14 17:20:39: ERROR[main]: ========== ERROR FROM LUA ===========
2016-04-14 17:20:39: ERROR[main]: Failed to load and run script from
2016-04-14 17:20:39: ERROR[main]: C:\Games\Minetest\bin\..\mods\smb\init.lua:
2016-04-14 17:20:39: ERROR[main]: C:\Games\Minetest\bin\..\mods\smb\init.lua:113: '=' expected near 'if'
2016-04-14 17:20:39: ERROR[main]: ======= END OF ERROR FROM LUA ========
2016-04-14 17:20:39: ERROR[main]: Server: Failed to load and run C:\Games\Minetest\bin\..\mods\smb\init.lua
2016-04-14 17:20:39: ERROR[main]: ModError: ModError: Failed to load and run C:\Games\Minetest\bin\..\mods\smb\init.lua
2016-04-14 17:20:39: ERROR[main]: Error from Lua:
2016-04-14 17:20:39: ERROR[main]: C:\Games\Minetest\bin\..\mods\smb\init.lua:113: '=' expected near 'if'
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)print("Super Mario Bros mod is loading....")
print("A mod by azekill_DIABLO on an idea of MineYoshi")
mobs:register_mob("smb:toad",
{type = "npc",
passive = false,
damage = 1,
attack_type = "dogfight",
attacks_monsters = true,
pathfinding = true,
collisionbox = {-0.4, -0.4, -0.4, 0.4, 0.6, 0.4},
visual = "sprite",
textures = {
{"toad.png"},},
blood_texture = "blood_smb.png",
makes_footstep_sound = true,
sounds = {
random = "snap",},
view_range = 25,
walk_velocity = 3,
run_velocity = 3,
jump = true,
drops = {
{name = "smb:toad",
chance = 0, min = 1, max = 1},},
owner = "",
order = "follow",
water_damage = 0,
lava_damage = 5,
light_damage = 0,
fear_height = 1,
on_rightclick = function(self, clicker)
-- by right-clicking owner can switch TOAD between follow and stand
if self.owner and self.owner == clicker:get_player_name() then
if self.order == "follow" then
self.order = "stand"
else
self.order = "follow"
end
end
end,})
mobs:register_egg("smb:toad", "TOAD YOUR BEST FRIEND", "toad.png", 1)
mobs:register_mob("smb:bowser", {
type = "monster",
passive = false,
damage = 8,
attack_type = "dogshoot",
reach = 0.5,
shoot_interval = 1,
arrow = "smb:bowser_breath",
shoot_offset = 1,
hp_min = 65,
hp_max = 65,
armor = 100,
collisionbox = {-0.7, -0.8, -0.7, 0.7, 0.7, 0.7},
visual = "sprite",
textures = {
{"bowser.png"},},
visual_size = {x=2, y=2},
blood_texture = "blood_smb.png",
makes_footstep_sound = true,
sounds = {
random = "mobs_dungeonmaster",
shoot_attack = "mobs_fireball",},
walk_velocity = 1,
run_velocity = 3,
jump = true,
view_range = 15,
drops = {
{name = "default:diamondblock", chance = 0, min = 1, max = 1},},
water_damage = 1,
lava_damage = 1,
light_damage = 0,
fear_height = 3,})
mobs:register_arrow("smb:bowser_breath", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"bowser_breath.png"},
velocity = 8,
-- direct hit, no fire... only scream and horror
hit_player = function(self, player)
player:punch(self.object, 0.5, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 0.5, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 8},
}, nil)
end,
-- node hit, bursts into flame (not too much)
hit_node = function(self, pos, node)
mobs:explosion(pos, 1, 0.5, 0.5)
end
})
mobs:register_egg("smb:bowser", "BOWSER YOUR WORST FOE", "bowser.png", 1)
--Reese chat
local_chat = function(pos,text,radius)
if radius == nil then
radius = 25
end
if pos ~= nil then
local oir = minetest.get_objects_inside_radius(pos, radius)
for _,p in pairs(oir) do
if p:is_player() then
minetest.chat_send_player(p:get_player_name(),text)
end
end
end
end
mobs:register_mob("smb:peach",
{type = "npc",
passive = true,
hp_min = 80,
hp_max = 80,
armor = 100,
collisionbox = {-0.3, -0.6, -0.3, 0.3, 0.3, 0.3},
visual = "sprite",
visual_size = {x=1.5, y=1.5},
textures = {
{"peach.png"},},
blood_texture = "flower.png",
makes_footstep_sound = true,
sounds = {
random = "snap",},
view_range = 25,
walk_velocity = 2,
run_velocity = 2,
jump = true,
drops = {
{name = "smb:peach",
chance = 0, min = 1, max = 1},},
water_damage = 0,
lava_damage = 0,
light_damage = 0,
fear_height = 10,
on_rightclick = function(self, clicker)
-- talk to the player
local_chat(clicker:getpos(),"Peach: Thank you for saving me!!!",3)
-- by right-clicking owner can switch PEACH between follow and stand
if self.owner and self.owner == clicker:get_player_name() then
if self.order == "follow" then
self.order = "stand"
else
self.order = "follow"
end
end
end,})
mobs:register_egg("smb:peach", "PEACH THE PRINCESS", "peach.png", 1)
mobs:register_mob("smb:goomba", {
type = "monster",
passive = false,
damage = 4,
attack_type = "dogfight",
reach = 1,
hp_min = 35,
hp_max = 35,
armor = 100,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "sprite",
textures = {
{"goomba.png"},},
visual_size = {x=1.5, y=1.5},
blood_texture = "blood_smb.png",
makes_footstep_sound = true,
sounds = {
random = "mobs_dungeonmaster",},
walk_velocity = 1,
run_velocity = 3,
jump = true,
view_range = 15,
drops = {
{name = "default:diamond", chance = 0, min = 1, max = 1},},
water_damage = 2,
lava_damage = 10,
light_damage = 0,
fear_height = 3,})
mobs:register_egg("smb:goomba", "GOOMBA THE... GOOMBA", "goomba.png", 1)
print("The SMB mod is loaded. Have Fun!!(and get rekt by bowser)")Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)thegreatone wrote:if pos ~= nil then <this line need to change out ~ with =
at least I THINK that may be what is throwing the error, I could be completely wrong. If I am then full apologies
mob.register("name", {
one = "two",
three = "four",
on_foo = function(player, pos)
local pos2 = {x = pos.x, y = pos.y + 1, z = pos.z}
minetest.chat_send_player(player:get_player_name(), "Hello!")
end
})
function something(one, two, three)
print(one .. " is " .. two .. " and " .. three)
end
thegreatone wrote:you have :
--Reese chat
local_chat = function(pos,text,radius)
if radius == nil then
radius = 25
end
if pos ~= nil then <this line need to change out ~ with =
at least I THINK that may be what is throwing the error, I could be completely wrong. If I am then full apologies
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)azekill_DIABLO wrote:thegreatone wrote:you have :
--Reese chat
local_chat = function(pos,text,radius)
if radius == nil then
radius = 25
end
if pos ~= nil then <this line need to change out ~ with =
at least I THINK that may be what is throwing the error, I could be completely wrong. If I am then full apologies
i will try what you said :)
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)Users browsing this forum: No registered users and 7 guests