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

How to add 1-time message ?

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello How i can improve this script:
LUA:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) == TRUE and getPlayerStorageValue(cid,2385) <= 0 then
		local message = "It seems you have found secret Greg\'s Laboratory."
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message)
		setPlayerStorageValue(cid, 2385, 1)
	end

	return true
end

If player stay on this sqm (uid=2385), the message appear only 1 time (if player stay 2-time nothing will pop up)

Anyone can help me ?
 
LUA:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) == TRUE and getPlayerStorageValue(cid,2385) == -1 then
		local message = "It seems you have found secret Greg\'s Laboratory."
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message)
		setPlayerStorageValue(cid, 2385, 1)
	end
 end

that should work
 
If your original script is giving you problems try this:

LUA:
function onStepIn(cid, item, position, fromPosition)
	if((isPlayer(cid)) and (getPlayerStorageValue(cid, 2385) -1)) then
		return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It seems you have found secret Greg\'s Laboratory."), setPlayerStorageValue(cid, 2385, 1)
	end
	return true
 end
 
@Up, all
Not working, still sending message multiple times :/
I want only message one time and if i step in on floor next time the msg dont pop up.
 
LUA:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) and getPlayerStorageValue(cid,2385) == -1 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It seems you have found secret Greg\'s Laboratory.")
		setPlayerStorageValue(cid, 2385, 1)
	end
	return true
end


17:12 It seems you have found secret Greg's Laboratory.
 
Back
Top