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

help with scripts

Keru

Entrepreneur
Joined
Jul 24, 2008
Messages
1,780
Solutions
2
Reaction score
170
Location
USA
hello i'm trying to learn how to script but its kind of hard can somebody help me with this to scripts.
this one is supp oust to remove a door and crate a wall else to remove a crate and create a stairs(it doesn't work) but i else want to if is the lever id 1946 go to 1945 by doing nothing you will see why
PHP:
--//Made by keru//--
--//Credits to the one that help me//--
function onUse(cid, item, fromPosition, itemEx, toPosition)
	puertapos = {x=1010, y=1010, z=7, stackpos=1}
	getpuerta = getThingfromPos(puertapos)
	cajapos = {x=1010, y=1014, z=7, stackpos=1}
	getcaja = getThingFromPos(cajapos)
	
	if getcaja.item == 1739 and item.itemid == 1945 and getpuerta.itemid == 1213 then
	  doRemoveItem(getpuerta.uid,1)
	  doCreateitem(5153,1,getpuerta)
      doTransformItem(getcaja.uid+327,item.itemid+1)
	  else 
      doPlayerSendCancel(cid,"Sorry, not possible.") 
	end
	
	return true
end

now a movement
when yo cimb up the ladder it go up(obiusly xD) and u stepin it change all to the original position :)
PHP:
--//Made by keru//--
--//Credits to the one that help me//--
function onStepIn(cid, item, pos)
    puertapos = {x=1010, y=1010, z=7, stackpos=1}
    getpuerta = getThingfromPos(puertapos)
    escalerapos = {x=1010, y=1014, z=7, stackpos=1}
    getescalera = getThingfromPos(escalerapos)
	
	if getpuerta.itemid == 5153 and getescalera == 1386 then
	     if isPlayer(cid) == TRUE then
	        doRemoveItem(getpuerta.uid,1)
	        doRemoveItem(getescalera.uid,1)
	        doCreateitem(1212,1,gatepos)

	
        end
     end

end
remember this two are my first scripts plz don't be bad.
 
aff xD ;_; srry its in spanish xD
PHP:
    puertapos = {x=1010, y=1010, z=7, stackpos=1} --door=puerta
    getpuerta = getThingfromPos(puertapos)        
    cajapos = {x=1010, y=1014, z=7, stackpos=1}   --caja=crate(it change crate to stair
    getcaja = getThingFromPos(cajapos)
 
Back
Top