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

Need help with a movement script!!

Joined
Sep 1, 2008
Messages
226
Reaction score
2
Location
Sweden
I made this script and it worked as I wanted it to work except one thing, and thats what I need help with...
This script works like this:

When you step on a stone tile, a stair being created...
When you move from the stone tile the stair is still there and I want it to dissapear.

Can someone help me with that ?


Here is the script I made...

Code:
function onStepIn(cid, item, position, fromPosition)
	if(item.actionid == 3506) and (getPlayerLevel(cid) >= 100) then
		doCreateItem(411, 1, {x=608, y=771, z=9})
	else
		doPlayerSendCancel(cid, "Sorry, you are not level 100 or higher.")
	end
	return TRUE
end
 
Code:
  <movevent type="StepIn" actionid="[COLOR="Red"]XXXX[/COLOR]" event="script" value="[COLOR="Red"]XXXX[/COLOR].lua"/>
  <movevent type="StepOut" actionid="[COLOR="Blue"]YYYYY[/COLOR]" event="script" value="[COLOR="Blue"]YYYY[/COLOR].lua"/>

Ground = id on ground title

XXXX.lua

Code:
function onStepIn(cid, item, pos, fromPosition)
getstair = getThingfromPos(stair)
stair = {x=[COLOR="Red"]XXXX[/COLOR], y=[COLOR="Red"]XXXX[/COLOR], z=[COLOR="Red"]XX[/COLOR]}
stairid = [COLOR="Red"]ID ON STAIR[/COLOR]
level = [COLOR="Red"]100[/COLOR]
message = [COLOR="Red"]You need level 100![/COLOR]

  if item.actionid == [COLOR="Red"]xxxx[/COLOR] and isPlayer(cid) == 1 then
    if getPlayerLevel(cid) >= level then
      doTransformItem(item.uid, item.itemid - 1)
      doCreateItem(stairid, stair)
      doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'Stair created!')
    else
      doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, message)
    end
  end
  return TRUE
end



YYYY.lua

Code:
function onStepOut(cid, item, pos, fromPosition)
level = [COLOR="Blue"]100[/COLOR]
time = [COLOR="Blue"]TIME TO REMOVE STAIR IN SECONDS[/COLOR]

  if item.actionid == [COLOR="Blue"]YYYY[/COLOR] and isPlayer(cid) == 1 then
    if getPlayerLevel(cid) >= level then
      doTransformItem(item.uid, item.itemid + 1)
      addEvent(removestair, time*1000)
    end
  end
  return TRUE
end

local function removestair(pos)
getstair = getThingfromPos(stair)
stair = {x=[COLOR="Blue"]YYYY[/COLOR], y=[COLOR="Blue"]YYYY[/COLOR], z=[COLOR="Blue"]YY[/COLOR], stackpos=1}

doRemoveItem(getstair.uid,1)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'Ladder removed!')
end
 
Last edited:
Ezzam @

I tryed it and got an error:
[07/05/2009 16:41:07] [Warning - Event::loadScript] Can not load script (data/movements/scripts/voc/stairs2.lua)
[07/05/2009 16:41:07] data/movements/scripts/voc/stairs2.lua:6: 'then' expected near ')'
[07/05/2009 16:41:07] [Warning - Event::loadScript] Can not load script (data/movements/scripts/voc/stairs.lua)
[07/05/2009 16:41:07] data/movements/scripts/voc/stairs.lua:3: '}' expected near 'stackpos'
:S
 
Try now, edited script, one i fucked up...

staits.lua (first) i dont really know what's wrong

Ok, I tryed and got some error but make it remove and now I only have one error:

[07/05/2009 17:44:55] [Warning - Event::loadScript] Can not load script (data/movements/scripts/voc/stairs.lua)
[07/05/2009 17:44:55] data/movements/scripts/voc/stairs.lua:6: '=' expected near 'level'
 
Back
Top