• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Help with onStepIn

Michael Orsino

Premium User
Premium User
Support Team
Joined
Nov 15, 2007
Messages
864
Solutions
10
Reaction score
451
Location
Western Australia
Trying to make my script do the following

When a player steps on the throne, message is printed and storage value is set.

What I have so far:
Code:
function onStepIn(cid, item, position, fromPosition)

	Absored = getPlayerStorageValue(cid,10001)

	if item.uid == 10001 then
	if Absorbed == -1 then
	doPlayerSendTextMessage(cid,22,"You have absorbed Verminor's spirit")
	setPlayerStorageValue(cid,10001,1)
	doPlayerSendCancel (cid,"Continue the quest")
	else
	doPlayerSendCancel (cid,"You have already absorbed Verminor's spirit")
end
end
return 1
end
The script seems to just doPlayerSendCancel (cid,"You have already absorbed Verminor's spirit"). I am not sure if it is actually setting the storage value.
 
Well if you get that message it means you got storage value more than 0 not -1:

Try this one: (Same but rediced and clean :D)

PHP:
function onStepIn(cid, item, position, fromPosition)
	local stor = getPlayerStorageValue(cid,10001)
	if item.uid == 10001 and stor == -1 then
		doPlayerSendTextMessage(cid,22,"You have absorbed Verminor's spirit")
		setPlayerStorageValue(cid,10001,1)
		doPlayerSendCancel (cid,"Continue the quest")
	else
		doPlayerSendCancel (cid,"You have already absorbed Verminor's spirit")
	end
return TRUE
end
 
Back
Top