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

Script don't create the monster.

Thunder Beam

New Member
Joined
Apr 23, 2008
Messages
107
Reaction score
0
Hello,

I need some help with this script, I want it to summon a monster (Diseased Bill) who can help? rep ++!

Code:
function onUse(cid, item, frompos, item2, topos)
local config = {
        storage = 5566, -- Storage Value
        monster = "Diseased Bill", -- Name of the monster
        message = "You wake up\'d Diseased Bill!", -- Message when you summon the monster
        cancelMessage = "You\'ve already wake\'d him up." -- Message if youve already summoned a monster
        }
        
    if getPlayerStorageValue(cid, config.storage) == -1 then
        doSummonCreature(cid, config.monster)
        setPlayerStorageValue(cid, config.storage, 1)
        doPlayerSendTextMessage(cid, 19, config.message)
    else
        doPlayerSendCancel(cid, config.cancelMessage)
    end
end

Thanks !

Thunder Beam
 
Lua:
doSummonCreature(cid, config.monster)

cid isn't a valid argument for this function.

Replace cid with config.monster.
Replace config.monster with the position to summon it.

Lua:
doSummonCreature(config.monster, {x=, y=, z=})
 
Thanks ! It works 100% :)

Now I have another question, Is it possible to give the player a storagevalue when you killed the monster ?
 
Lua:
local storage = 12345
local bosses = {
	["Morgaroth"]
}
function onKill(cid, target, lastHit)
    for name, pos in pairs(bosses) do
    if name == getCreatureName(target) then
	setPlayerStorageValue(cid, storage, 1)
    end
    return TRUE
end
 
Code:
local monsters = {
	["morgaroth"] = 12345,
	["demon"] = 12346
}

function onKill(cid, target, lastHit)
	local now = monsters[string.lower(getCreatureName(target))]
	if (not now) then
		return true
	end

	setPlayerStorageValue(cid, now, 1)
	return true
end
 
I get this error:

[22/09/2009 15:53:36] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/fred.lua)
[22/09/2009 15:53:36] data/creaturescripts/scripts/fred.lua:4: '=' expected near '}'

Help/fix please !?
 
Last edited:
Back
Top