urgente.como repeat a mod

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

urgente.como repeat a mod

by BrunoMine » Mon May 27, 2013 19:00

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!
Last edited by sfan5 on Wed May 29, 2013 05:22, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Tue May 28, 2013 02:22

... 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!
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Tue May 28, 2013 02:54

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,
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Tue May 28, 2013 22:33

perfect. thank you
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Wed May 29, 2013 04:07

You are welcome. I hope the presentation went/is going to go well.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Wed May 29, 2013 15:11

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
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Wed May 29, 2013 15:36

Last edited by tinoesroho on Wed May 29, 2013 15:37, edited 1 time in total.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 15 guests