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

simple script help

Cloow

Active Member
Joined
May 10, 2010
Messages
1,086
Reaction score
35
when I run the script it sends me "You need to find the four pieces of crystal first." I have all the storageids

yhrcLF.png


Console error when I use the forge
[21/01/2013 15:51:11] [Error - Action Interface]
[21/01/2013 15:51:11] data/actions/scripts/crstoneswitch.lua:eek:nUse
[21/01/2013 15:51:11] Description:
[21/01/2013 15:51:11] (luaGetCreatureStorage) Creature not found


Lua:
function onUse(cid, item, frompos, item2, topos)
        if getPlayerStorageValue(cid) == 31587 and getPlayerStorageValue(cid) == 31588 and getPlayerStorageValue(cid) == 31589 and getPlayerStoragevalue(cid) == 31590 then
                doPlayerSendTextMessage(cid, 22, "You put the four pieces of crystal together and a crystal sword was created!")
				doPlayerAddItem(cid, 11449, 1)
                setPlayerStorageValue(cid, 31599, 1)
        elseif getPlayerStorageValue(cid) == 31599 then
                doPlayerSendTextMessage(cid, 22, "You already found the pieces")
        else
                doPlayerSendTextMessage(cid, 22, "You need to find the four pieces of crystal first.")
        end
return true
end


The crystals
Lua:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid, 31590) <= 0 then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You found a piece of green crystal.")
	setPlayerStorageValue(cid, 31590, 1)
	elseif getPlayerStorageValue(cid, 31590) >= 1 then
	doPlayerSendCancel(cid, "There is nothing there")
	end
	return true
 end
Lua:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid, 31589) <= 0 then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You found a piece of light blue crystal.")
	setPlayerStorageValue(cid, 31589, 1)
	elseif getPlayerStorageValue(cid, 31589) >= 1 then
	doPlayerSendCancel(cid, "There is nothing there")
	end
	return true
 end
Lua:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid, 31588) <= 0 then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You found a piece of red crystal.")
	setPlayerStorageValue(cid, 31588, 1)
	elseif getPlayerStorageValue(cid, 31588) >= 1 then
	doPlayerSendCancel(cid, "There is nothing there")
	end
	return true
 end
Lua:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid, 31587) <= 0 then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You found a piece of blue crystal.")
	setPlayerStorageValue(cid, 31587, 1)
	elseif getPlayerStorageValue(cid, 31587) >= 1 then
	doPlayerSendCancel(cid, "There is nothing there")
	end
	return true
 end
 
Your getPlayerStorageValues are incorrect.

Look at this line:
Lua:
if getPlayerStorageValue(cid) == 31587 and getPlayerStorageValue(cid) == 31588 and getPlayerStorageValue(cid) == 31589 and getPlayerStoragevalue(cid) == 31590 then

Shouldn't they be getPlayerStorageValue(cid, 31587) >= 1, so on so forth?
 
Last edited:

Similar threads

Back
Top