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

Switch Snake God Essence Bug

Status
Not open for further replies.

djtuca

Technical Support
Joined
Jun 25, 2011
Messages
198
Reaction score
3
Location
Brazil
I Have this script and have error in console ( attached file )

How to solve this?

Code:
function onUse(cid, item, frompos, item2, topos)
	if(item.actionid == 32146) and getPlayerStorageValue(cid,42830) == 5 then -- teleport to the last room
		for x = 33357, 33362 do
			for y = 31404, 31409 do
				pos = {x = x, y = y, z = getCreaturePosition(cid).z}
				if(isPlayer(getTopCreature(pos).uid)) then
				doTeleportThing(cid, {x=33359, y=31407, z=10})
				doSendMagicEffect(getPlayerPosition(cid), 23)
				end
			end
		if(not(getCreatureByName("snake god essence"))) then
			doSummonCreature("snake god essence", {x = 33363, y = 31400, z = 10})

	end
        return TRUE
end

- - - Updated - - -

Solved by tetra20 - Very Thanks

Code:
function onUse(cid, item, frompos, item2, topos)
	if(item.actionid == 32146) and getPlayerStorageValue(cid,42830) == 5 then -- teleport to the last room
		for x = 33357, 33362 do
			for y = 31404, 31409 do
				pos = {x = x, y = y, z = getCreaturePosition(cid).z}
				if(isPlayer(getTopCreature(pos).uid)) then
				doTeleportThing(cid, {x=33359, y=31407, z=10})
				doSendMagicEffect(getPlayerPosition(cid), 23)
				end
			end
		if(not(getCreatureByName("snake god essence"))) then
			doSummonCreature("snake god essence", {x = 33363, y = 31400, z = 10})

	end
        return TRUE
end
end
end
 

Attachments

Last edited:
you need to close the loops :) not just add end's to the bottom.
I will try to explain it like this:
You are traveling and you need to stop cus you need a bathroom, the next bathroom. A police is below you and you need (rly need a bathroom), you will wait until the next station (5min travel) or just piss over there?
You can piss when you want but is bad done (ends at the bottom) or just take the easier way and wait until the next station (add the ends when you need to cut the function) and with this, the police officer won't stop you.

Sorry for my bad english if you don't understand something, but I always think that if you use real and normal things for examples you can understand it easier. I learn the basic of lua like that, using the real life problems.
 
Status
Not open for further replies.
Back
Top