Page 1 of 1

urgente.como repeat a mod

PostPosted: Mon May 27, 2013 19:00
by BrunoMine
I'm using a mod spawn to teleport. It's a mod I downloaded folder "Vanessae_game"

See the two init that was in the mod folder

At first he was like:

init
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_on_chat_message(function(name, message, playername, player)
    local cmd = "/spawn"
    if message:sub(0, #cmd) == cmd then
        if message == '/spawn' then
            local player = minetest.env:get_player_by_name(name)
            minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
            player:setpos({x=-307, y=20, z=-426})
            return true
        end
    end
end)



After I took a few adjustments and looked like this:

init
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_on_chat_message(function(name, message, playername, player)
    local cmd = "/preinicio"
    if message:sub(0, #cmd) == cmd then
        if message == '/preinicio' then
            local player = minetest.env:get_player_by_name(name)
            minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
            player:setpos({x=643, y=11, z=937})
            return true
        end
    end
end)




I want to do most others. but do not know which part has to change and we have to do.

Help me please. I have to give this game tomorrow morning at school for a presentation!

PostPosted: Tue May 28, 2013 02:22
by tinoesroho
... Paste this into chatcommands.lua:
minetest.register_chatcommand("preinicio", {
params = "",
description = "Go to spawn",
privs = {},
func = function(name, param)
local player = minetest.env:get_player_by_name(name)
minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
player:setpos({x=643, y=11, z=937})
return true
end,
})

I'm assuming you are using 0.4.6. This should work! I will test and report my results.

init~ is a backup created by a text editor. Don't worry about it.

Here's to a successful presentation!

***
Do remember to state the version of Minetest you are using. It helps debuggers!

PostPosted: Tue May 28, 2013 02:54
by tinoesroho
Tested. Here is the working code:

minetest.register_chatcommand("preinicio", {
params = "",
description = "Go to spawn",
privs = {},
func = function(name, param)
local player = minetest.env:get_player_by_name(name)
minetest.chat_send_player(name, "Teletransporte para desovar...")
player:setpos({x=643, y=11, z=937})
return true
end,
})


For some reason,

PostPosted: Tue May 28, 2013 22:33
by BrunoMine
perfect. thank you

PostPosted: Wed May 29, 2013 04:07
by tinoesroho
You are welcome. I hope the presentation went/is going to go well.

PostPosted: Wed May 29, 2013 15:11
by BrunoMine
tinoesroho wrote:You are welcome. I hope the presentation went/is going to go well.


actually I present to teachers in my school.
They liked the idea of using a game to teach the material more attractive.
Have not shown. I'll show next week
I wish I could implement mod to display text and images. The plates are very bad, I have to put several to complete a text, that's too bad but I'll see if they approve the idea. Mainly because it is free, this game is very viable

PostPosted: Wed May 29, 2013 15:36
by tinoesroho