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

Solved Easy script needed!

Status
Not open for further replies.

eyteew

es neko nesaprotu :D
Joined
Nov 25, 2009
Messages
104
Reaction score
0
Location
Thais
Hello! (tfs 0.3.6 pl1, 8.60)
I need script:
when you step on teleport with uniqueid 1000 then
if playerstoragevalue 0001 == 1 and
playerstoragevalue 0002 == 1 and
playerstoragevalue 0003 == 1 then
teleport to x,y,z

I'm really not programmer, but i tried to bake something and i guess it's almost working :D
Lua:
function onStepIn(cid, item, pos)
   	if item.uid == 10100 then
		if getPlayerStorageValue(cid,10001) == 1
		getPlayerStorageValue(cid,10002) == 1
		getPlayerStorageValue(cid,10003) == 1
		getPlayerStorageValue(cid,10004) == 1
		getPlayerStorageValue(cid,10005) == 1
		getPlayerStorageValue(cid,10006) == 1
       	getPlayerStorageValue(cid,10007) == 1 then
	doTeleportThing(cid,{x=32829, y=32243, z=11})
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
     doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Congratulations!')
else
doTeleportThing(cid,{x=32824, y=32232, z=12})
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You haven\'t done all rooms!')
	end
	return true
end
end
 
Last edited:
Lua:
function onStepIn(cid, item, pos)
   	if item.uid == 10100 then
		if getPlayerStorageValue(cid,10001) == 1 and getPlayerStorageValue(cid,10002) == 1 and getPlayerStorageValue(cid,10003) == 1 and getPlayerStorageValue(cid,10004) == 1 and getPlayerStorageValue(cid,10005) == 1 and getPlayerStorageValue(cid,10006) == 1 and getPlayerStorageValue(cid,10007) == 1 then
			doTeleportThing(cid,{x=32829, y=32243, z=11})
			doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Congratulations!')
		else
			doTeleportThing(cid,{x=32824, y=32232, z=12})
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You haven\'t done all rooms!')
		end
		return true
	end
end
 
you can set uniqueid checking at scripts's xml line of movements.xml
shorter
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)    
    for key = 10001, 10007 do
        if getCreatureStorage(cid, key) ~= 1 then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You haven\'t done all rooms!')
            return doTeleportThing(cid, {x=32824, y=32232, z=12})
        end
    end
        
    doTeleportThing(cid, {x=32829, y=32243, z=11})
    doSendMagicEffect(getThingPos(cid), CONST_ME_BIGCLOUDS)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Congratulations!')
end
 
Almost fine. Only thing not working - when playersstoragevalue is not 1, it says "you havent done all rooms" but anyway teleport to position like if storagevalue were 1

- - - Updated - - -

w8, what destination coordinates must has teleporter, if I use such script? I tried to set 0,0,0 but i cant.
 
Yep, it's your same script
JtASbu.png


If you want it to not teleport player to another pos and make him do "walkback" :
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)	
	for key = 10001, 10007 do
		if getPlayerStorageValue(cid, key) ~= 1 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You haven\'t done all rooms!')
			return doTeleportThing(cid, fromPosition)
		end
	end
		
	doTeleportThing(cid, {x=32829, y=32243, z=11})
	doSendMagicEffect(getThingPos(cid), CONST_ME_BIGCLOUDS)
	doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Congratulations!')
end
 
ah, i know, i should use another item (not teleporter) and set that uniqueid. it must work then!
thank you, if it will work, you both will get rep :)
 
XML:
<movevent type="StepIn" uniqueid="2020" event="script" value="script.lua"/>
 
Status
Not open for further replies.
Back
Top