• 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!

kinda bugged script

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
so the script is here
PHP:
local config = {
    tile = 7667,
	uniqueid= 1664,
    monster = "Vampire",
    spawn = {
        { x = 831, y = 895, z = 7, stackpos = 1 },
		{ x = 830, y = 895, z = 7, stackpos = 1 },
		{ x = 829, y = 897, z = 7, stackpos = 1 },
		{ x = 828, y = 894, z = 7, stackpos = 1 },
		{ x = 829, y = 897, z = 7, stackpos = 1 }
		
    },
    storage = 1020,
}
 
function onStepIn(cid, item, frompos, item2, topos)
    if item.uid == config.uniqueid and item.itemid == config.tile then
        if getGlobalStorageValue(45000) >= os.time() then
            doPlayerSendCancel(cid,"Grrrr")
			end
			if isPlayer(cid) then	
			for i = 1, table.maxn(config.spawn) do
                doSummonCreature(config.monster, config.spawn[i])
				setGlobalStorageValue(45000, os.time() + 60)
            end
        end
    else
        doPlayerSendCancel(cid, "Grrrr.")
    end
    return TRUE
end

if player steps on x/y/z script summons vampires .
the problem is that then some monster steps on that tile x/y/z to summon monsters tfs getting error
HTML:
[18/05/2012 21:50:19] [Error - MoveEvents Interface] 
[18/05/2012 21:50:19] data/movements/scripts/summontile1.lua:onStepIn
[18/05/2012 21:50:19] Description: 
[18/05/2012 21:50:19] (luaDoPlayerSendCancel) Player not found

how to fix it ? then monsters steps on that tile nothing should happend , then player steps on that tile vampire should by summoned .

how to fix it ?
 
Creature is not a player, so it bugs.
Try to add these:
LUA:
local pos = {x=, y= z=} -- position
 
local text = "Grrr." -- any text
local effect = 35 -- the effect
 
doSendAnimatedText(pos, text, effect)
 
Creature is not a player, so it bugs.
Try to add these:
LUA:
local pos = {x=, y= z=} -- position
 
local text = "Grrr." -- any text
local effect = 35 -- the effect
 
doSendAnimatedText(pos, text, effect)

add it where? on with lane ?
 
By the looks of your avatar I kinda thought you knew this already.

LUA:
local config = { 
    tile = 7667, 
    uniqueid= 1664, 
    monster = "Vampire", 
    spawn = { 
        { x = 831, y = 895, z = 7, stackpos = 1 }, 
        { x = 830, y = 895, z = 7, stackpos = 1 }, 
        { x = 829, y = 897, z = 7, stackpos = 1 }, 
        { x = 828, y = 894, z = 7, stackpos = 1 }, 
        { x = 829, y = 897, z = 7, stackpos = 1 } 
         
    }, 
    storage = 1020, 
} 
  
function onStepIn(cid, item, frompos, item2, topos) 
	if isPlayer(cid) then
		if item.uid == config.uniqueid and item.itemid == config.tile then 
			if getGlobalStorageValue(45000) >= os.time() then 
				doPlayerSendCancel(cid,"Grrrr") 
			end  
			for i = 1, table.maxn(config.spawn) do 
				doSummonCreature(config.monster, config.spawn[i]) 
				setGlobalStorageValue(45000, os.time() + 60) 
			end 
		else 
			doPlayerSendCancel(cid, "Grrrr.") 
		end 
		return TRUE 
	end
end

Adding one extra check to verify that the one triggering the script is a player is extremely basic lua scripting.
 
thanks Znote ,
ah i added this avatar then i had just 20 posts on start then i joined otland just for run. gonna edit it xD

thanks again
 
Back
Top