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

Lua OnStepIn Script, SOMETHING IS WRONG!!

Synergy

New Member
Joined
Nov 24, 2011
Messages
334
Reaction score
0
startmsg.lua:
Code:
local storage = 14326
 

   function onStepIn(cid, item, fromPosition, toPosition)
	if(getCreatureStorage(cid, storage) < 0) then
		doPlayerSendTextMessage(cid, 19, "You should go and see Sarah and her farm west from here, she will give you your first task!")
		doCreatureSetStorage(cid, storage, 1)
	end
end

movements.xml:
Code:
        <movevent type="StepIn" aid="12555" event="script" value="startmsg.lua"/>
        <movevent type="StepIn" aid="12556" event="script" value="startmsg.lua"/>
        <movevent type="StepIn" aid="12557" event="script" value="startmsg.lua"/>



Why isn't this working? When I step on the tile it doesnt say anything and nothing happens, even in console, nothing.
 
LUA:
local storage = 14326
 

   function onStepIn(cid, item, fromPosition, toPosition)
	if(getCreatureStorage(cid, storage) < 1) then
		doPlayerSendTextMessage(cid, 19, "You should go and see Sarah and her farm west from here, she will give you your first task!")
		doCreatureSetStorage(cid, storage, 1)
	end
end
 
Try removing the spaces in (cid, ", -) example:

Code:
doPlayerSendTextMessage(cid,22,"You should go and see Sarah bla bla bla!")

Also try changin the 19 for > 22.
 
Code:
        <movevent type="StepIn" actionid="12555" event="script" value="startmsg.lua"/>
        <movevent type="StepIn" actionid="12556" event="script" value="startmsg.lua"/>
        <movevent type="StepIn" actionid="12557" event="script" value="startmsg.lua"/>

try it
 
Try removing the spaces in (cid, ", -) example:

Code:
doPlayerSendTextMessage(cid,22,"You should go and see Sarah bla bla bla!")

Also try changin the 19 for > 22.

It worked, but it didnt pop up. It only showed in server log

I want it popping up in orange text
 
LUA:
local storage = 12345
function onStepIn(cid, item, fromPosition, toPosition)
	if(isPlayer(cid) and getCreatureStorage(cid, storage) < 0) then
		doCreatureSay(cid, "Message here.", TALKTYPE_MONSTER)
		doCreatureSetStorage(cid, storage, 1)
	end
end
 
Last edited:
Back
Top