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

Help with script

mahant

Banned User
Joined
May 15, 2010
Messages
111
Reaction score
1
Code:
local t = {
    storage = 32001,
    monster = {"MONSTER", {x=1140, y=833, z=9}},
    msg = "Oh no! Elder Beholder appeared, you have to kill him to get out of here.."
}
function onStepIn(cid, item, position, fromPosition)
    if getPlayerStorageValue(cid, t.storage) < 1 then       
        doCreatureSay(cid, t.msg, TALKTYPE_ORANGE_1)
        doSummonCreature(t.monster[1], t.monster[2])
        setPlayerStorageValue(cid, t.storage, 1)
    end
    return TRUE
end

It makes MONSTER everytime if some CREATURE will stay at this script pos. But i want only if player will stay there, please fast help. :|
 
This might work, now you also need to be a vocation, monsters don't have a vocation right?
LUA:
local t = {
    storage = 32001,
    monster = {"MONSTER", {x=1140, y=833, z=9}},
    msg = "Oh no! Elder Beholder appeared, you have to kill him to get out of here.."
}
function onStepIn(cid, item, position, fromPosition)
    if getPlayerStorageValue(cid, t.storage) < 1 and getPlayerVocation(cid) >=1 then
        doCreatureSay(cid, t.msg, TALKTYPE_ORANGE_1)
        doSummonCreature(t.monster[1], t.monster[2])
        setPlayerStorageValue(cid, t.storage, 1)
else
doPlayerSendCancel(cid,"A")
    end
    return TRUE
end
 
LUA:
local t = {
    storage = 32001,
    monster = {"MONSTER", {x=1140, y=833, z=9}},
    msg = "Oh no! Elder Beholder appeared, you have to kill him to get out of here.."
}
function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) and getPlayerStorageValue(cid, t.storage) < 1 then       
        doCreatureSay(cid, t.msg, TALKTYPE_ORANGE_1)
        doSummonCreature(t.monster[1], t.monster[2])
        setPlayerStorageValue(cid, t.storage, 1)
    end
    return TRUE
end
 
Works, great dude, Thanks. - Znote.

Works, but is error

Code:
[14:22:08.917] [Error - MoveEvents Interface] 
[14:22:08.917] data/movements/scripts/trap.lua:onStepIn
[14:22:08.917] Description: 
[14:22:08.917] (internalGetPlayerInfo) Player not found when requesting player info #6

[14:22:08.917] [Error - MoveEvents Interface] 
[14:22:08.917] data/movements/scripts/trap.lua:onStepIn
[14:22:08.917] Description: 
[14:22:08.917] data/movements/scripts/trap.lua:7: attempt to compare number with boolean
[14:22:08.917] stack traceback:
[14:22:08.917] 	data/movements/scripts/trap.lua:7: in function <data/movements/scripts/trap.lua:6>
 
Last edited by a moderator:
Back
Top