rubenwardy wrote:You should rarely use global variables as they will be present in other mods. You should only create global variables with the same name as your mod.
-- You can do this if you want want to make a global variable,
-- but I usually use nameofmod.sound as I prefer that personally.
local sound = "no"
dofile(minetest.get_modpath() .. "/other.lua", sound)
local sound = 'no'
minetest.register_tool("headphones:1headphones", {
description = "Headphones Test Song",
inventory_image = "testh.bmp",
on_use = function()
if sound == 'no' then
sound = minetest.sound_play("test") --keep the "reference" of the sound
else
minestes.sound_stop(sound) --stop the sound
sound = 'no'
end
end,
})
MineYoshi wrote:I think i am a little dumb, or i don't know the "enough" yet!
Anyways THX!
iangp wrote:MineYoshi wrote:I think i am a little dumb, or i don't know the "enough" yet!
Anyways THX!
Not really, you just need practice.
make little challenges to yourself:
exercises, big projects, read some good book/e-book (not only about Lua),
It comes along with time, so be patient.
And of course think out the box :D
creativity helps to find a nicer way to solve a problem.
Don wrote:iangp wrote:MineYoshi wrote:I think i am a little dumb, or i don't know the "enough" yet!
Anyways THX!
Not really, you just need practice.
make little challenges to yourself:
exercises, big projects, read some good book/e-book (not only about Lua),
It comes along with time, so be patient.
And of course think out the box :D
creativity helps to find a nicer way to solve a problem.
I agree! I have been slowly learning. I still have a lot more to learn. Every challenge I give myself makes me have a little more knowledge. Keep trying.
mahmutelmas06 wrote:i use formspecs to make a coffee machine but i need help
can i use itemgroup instead of an item ?
for exp instead of "flowers:tulip" i want to use group flowers
inv:contains_item("src", ItemStack("flowers:tulip"))
Lucki wrote:How I can check, a player is death? If this happens I want to Drop an Item.
And sorry for my english because i´m from germany and 12 years old.
I want to make a "Capture the FlagMod"
rubenwardy wrote:For length: #str
For character: str.sub(i, 1)
BrunoMine wrote:[...]I want to create a verification loop of characters in a string.
if str:find("[^A-Za-z0-9]") then
error("please only use letters or digits")
end
local start, fin, what = str:find("[^A-Za-z0-9]")
if start then
error("character "..what.." (at position "..start..") is not allowed")
end
str:find("%W")ynong123 wrote:Question: How to post a topic?
Reason: I want to release a mod.
MineYoshi wrote:how to make, when i click a chest of one space(left click) with a craft_item, drop the item in the chest?
BrunoMine wrote:How can I place an item in a biome.
For example: I want to appear in a chest in a jungle forest.
I can not check the area next to jungle trees that have just been generated.
Users browsing this forum: No registered users and 2 guests