• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Help me in this event!!!!

ninexin

insane.sytes.net
Joined
Jun 10, 2007
Messages
213
Reaction score
3
Location
Brazil
look this code:
PHP:
local configs = {townStart = 13, turn = 1, regnLife = true, broadCast = true, townProceed = false} 
function onThink(interval, lastExecution)
                for i,b in pairs(getOnlinePlayers()) do
                    local creature = getPlayerByName(b)
                if (configs.regnLife == true) then
                        doCreatureAddHealth(creature, getCreatureMaxHealth(creature))
                    end
                if (configs.broadCast == true) then
                        doBroadcastMessage("Changing TURN! ["..configs.turn.."]")
                    end
                if (configs.townProceed == true) then
                        configs.townStart = configs.townStart+1
                    end
                    configs.turn = configs.turn + 1
    doTeleportThing(creature, getTownTemplePosition(configs.townStart))
    print("Turn changed! Town "..configs.townStart.." and Turn "..configs.turn)
    end
  return TRUE
end

this works as follows, teleports all players to a certain place.
but I want to add if the player is with a storage "X" then the player dont go to new position.

plx helpe me and sorry my inglish
 
LUA:
local configs = {townStart = 13, turn = 1, regnLife = true, broadCast = true, townProceed = false, storage = 1999} 
function onThink(interval, lastExecution)
	for _, cid in ipairs(getPlayersOnline()) do
		if (configs.regnLife == true) then
			doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		end
		if (configs.broadCast == true) then
			doBroadcastMessage("Changing TURN! ["..configs.turn.."]")
		end
		if (configs.townProceed == true) then
			configs.townStart = configs.townStart+1
		end
		configs.turn = configs.turn + 1
		if (getPlayerStorageValue(cid, configs.storage) ~= 1) then
			doTeleportThing(cid, getTownTemplePosition(configs.townStart))
		end
	end
	print("Turn changed! Town "..configs.townStart.." and Turn "..configs.turn)
return true
end
 
Last edited:
Back
Top