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

Lua script error

Tibiamakers

yourolist.com
Joined
May 24, 2010
Messages
1,377
Reaction score
97
Location
España
Code:
local ghazbaranstorage = 10001
local ghazbaranteleport = {x=552, y=645, z=3} --Location to teleport to on the map if you pull the lever

        --ghazbaran Kill
   	if item.uid == 1 then
   		queststatus = getPlayerStorageValue(cid,ghazbaranstorage)
   		if queststatus == 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations Blackland habitant you have defeated a Ghazbaran, take you reward.")
                        doTeleportThing(cid,ghazbaranteleport)
	                doSendMagicEffect(ghazbaranteleport,10)
   		else
   			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to defeat a ghazbaran to use this lever.")
   		end
	end
end



Dibujo.JPG







Can't find an error in line 5 :huh:
 
Code:
local ghazbaranstorage = 10001
local ghazbaranteleport = {x=552, y=645, z=3} --Location to teleport to on the map if you pull the lever


       queststatus = getPlayerStorageValue(cid,ghazbaranstorage)
   		if queststatus == 10001 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations Blackland habitant you have defeated a Ghazbaran, take you reward.")
                        doTeleportThing(cid,ghazbaranteleport)
	                doSendMagicEffect(ghazbaranteleport,10)
   		else
   			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to defeat a ghazbaran to use this lever.")
   		end

 
Try this:

LUA:
function onUse(cid, item, topos, item2, frompos)
	
	local p = {x=552, y=645, z=3}

	if item.itemid == 1945 then
		if getPlayerStorageValue(cid, 10001) ~= 1 then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to defeat a ghazbaran to use this lever.")
			else
				doTeleportThing(cid, p)
				doSendMagicEffect(p, 10)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations Blackland habitant you have defeated a Ghazbaran, take you reward")
				doTransformItem(item.uid, 1946)
			end
		end

	return TRUE
end
 
This is just the script for the lever, you need some kind of creaturescript to make it set storageValue when it's dead lol
 
Back
Top