AMMOnym wrote:Can someone explain me what is wrong on this mod ?
AMMOnym wrote:Can someone explain me what is wrong on this mod ?
dofile(minetest.get_modpath("slender").."/api.lua")
minetest.register_node("slender:slenderwater_flowing", {
description = "Flowing Fear",
...
Hybrid Dog wrote:what is api.lua good for?
benedict424 wrote: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
on_use = function(itemstack, user, pointed_thing)
local playerpos = minetest.player:getpos()
local playerpos = user:getpos()
AMMOnym wrote:Is any way, how to make an invisible water ?
DeepGaze wrote:textures, or do you mean whilst you are inside?
Hybrid Dog wrote:AMMOnym wrote:Is any way, how to make an invisible water ?
do you mean more realistic water like in sauerbraten?
Achilles wrote:Is there any way for an admin to check a users IP using a command on servers? It would be quite helpful if there was in the case of account theft...
minetest.register_chatcommand("get_ip", {
params = "<name>",
description = "tells the ip address of someone",
privs = {server=true},
func = function(name, param)
if not param
or not name then
return false, "Something failed."
end
return true, param.."'s ip address: "..minetest.get_player_ip(param)
end,
})
Linuxdirk wrote:I wonder how the IP address will help on server account theft since IPs are usually randomly assigned by the ISP.
Superdude44 wrote:Topic: What is the default block size when modeling in blender?
Reason: I'd like to make models and I wanted to size them correctly
philipbenr wrote:Verified. A 1x1x1 cube is the size of a node in Minetest.
Now for my own question: How would bumpmapping for a meshnode be done? Is there a way in Blender? Or in Minetest? Or neither?
Linuxdirk wrote:Is there a way to add text to the HUD like the Minetest version information in the top left corner? Or is there a way to alter that text without changing the source code and re-compile it?
minetest.register_on_joinplayer(function(player)
-- Delay a bit.
minetest.after(1, function()
player:hud_add({
hud_elem_type = "text",
-- Hud position.
-- {x=0, y=0} -> top-left
-- {x=1, y=1} -> bottom-right
-- etc.
position = {x=1, y=0}, -- top-right
alignment = {x=1, y=1}, -- Align top-right.
text = "asdf",
number = 0xFFFF00, -- Color as 0xRRGGBB
})
end) -- after()
end) -- on_joinplayer()
kaeza wrote:See player:hud_add.
Linuxdirk wrote:I created a mod with only your example in init.lua.There is no text at the top right and I’m not seeing any error messages.
alignment = { x=-1, y=1 },
offset = {x=-8, y=8 }, -- Shift 8 pixels to the left, and 8 pixels down.
Linuxdirk wrote:Ah, now that’s something I can work with! Thanks! :) Is there a way to change the text (altering or remove/re-set)?
player:hud_change(hud_id, "text", "qwerty") -- "qwerty" is the new value for the "text" property.
function doEventThingy()
-- do some code
minetest.after(doEventThingy, mins * 60)
end
minetest.after(doEventThingy, mins * 60)
kaeza wrote:you must store the value returned by `hud_add` somewhere
minetest.register_on_joinplayer(function(player)
-- Delay a bit.
minetest.after(1, function()
hud_id = player:hud_add({
hud_elem_type = 'text',
position = {x=1, y=0},
alignment = {x=-1, y=1},
text = 'First text',
number = 0xFFFFFF,
offset = {x=-4, y=4}
})
end)
end)
function changeText()
player:hud_change(hud_id, 'text', 'Changed text')
minetest.after(5, changeText)
end
minetest.after(5, changeText)
07:46:25: ACTION[ServerThread]: singleplayer leaves game. List of players:
07:46:25: ERROR[main]: ServerError: /home/dirk/.minetest/mods/lp/init.lua:16: attempt to index global 'player' (a nil value)
07:46:25: ERROR[main]: stack traceback:
07:46:25: ERROR[main]: /home/dirk/.minetest/mods/lp/init.lua:16: in function 'func'
07:46:25: ERROR[main]: /usr/share/minetest/builtin/game/misc.lua:17: in function '?'
07:46:25: ERROR[main]: /usr/share/minetest/builtin/game/register.lua:348: in function </usr/share/minetest/builtin/game/register.lua:336>
Users browsing this forum: No registered users and 10 guests