• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Help 2 things on my Game of Thrones event

so you need to edit this script to add a new storage value for each city.

So how its work:
Script to guild own can acess
Code:
local guilds = {
--[actionid] = número da cidade configurado em cityMonsters,
[2391] = 1,
[2392] = 2,
[2393] = 3,
[2394] = 4,
[2395] = 5,
[2396] = 6,
[2397] = 7,
[2398] = 8,
}
function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then return true end
local guildId = getGlobalStorageValue(guilds[item.actionid] + DEFAULT_STORAGE)
if getPlayerGuildId(cid) ~= guildId then
doTeleportThing(cid, fromPosition)
doPlayerSendCancel(cid, 'This territory is not of your Guild')
end
return true
end

This script is very confusing for me
 
it's pretty simple, getGlobalStorageValue (actionid + default_storage), after check if player have it to let him pass throught, and actually already each city has a storage value which is actionid + default_storage.
 
Last edited:
So...
guild own carlin = 51589 (49198+2391)?
guild own thais = 51590 (49198+2392)? ...


What is this 1,2,3... \/
Code:
[2391] = 1,
[2392] = 2,
[2393] = 3,
 
What i made worng?
first of all your lua syntax completely wrong, for loops on lua automatically increase +1 to variable, so you don't need do += or +1 (+= are another syntax mistake to lua as well), as far i know there is no way stop attacking or refuse a attack through lua, anyway you cant just add new creature event from nothing, i never heard before about target event the only ones i ever meet is that ones https://github.com/otland/forgottenserver/blob/master/src/creatureevent.cpp#L166-188, i dont know how your system work, easiest way to block a player to target monster is prevent player reach the monster with stepin/out.
 
Last edited:
Back
Top