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

A simple movement, easy for any kind of scripter...

Archez

'
Senator
Joined
Jun 26, 2008
Messages
6,589
Solutions
1
Reaction score
71
Location
Mexico
movement-1.png


:)

Thanks,
 
Here ya go

Code:
function onStepIn(cid, item, pos)
place = {x=32716, y=32346, z=7} --Place u want the Tp to go

        if getPlayerStorageValue(cid,30) == -1 then
            setPlayerStorageValue(cid,30,1)
            doTeleportThing(cid,place)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Gratz u went thru the TP!')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Youve already gone in the TP')
            doTeleportThing(cid, fromPosition, TRUE)
        end
		end
 
@Up
I think your script wont work perfectly.. You missed the return and a "FALSE/TRUE" in doTeleportThing function..

@Archez
Try it. i just edited the script..
Lua:
function onStepIn(cid, item, pos)
local place = {x=32716, y=32346, z=7} --Place you want the tp to go
local cidstorage = 1155
local cidpos = getPlayerPosition(cid)

        if getPlayerStorageValue(cid, cidstorage) == -1 then
            setPlayerStorageValue(cid,30,1)
            doTeleportThing(cid, place, FALSE)
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can pass.")
        else
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You've already gone there")
            doTeleportThing(cid, {x = cidpos.x, y = cidpos.y+1 , z = cidpos.z}, FALSE)
        end
        return TRUE
end
 
Last edited:
Am I supposed to change this line:
Lua:
            setPlayerStorageValue(cid,30,1)

to:

Lua:
            setPlayerStorageValue(cid,1155,1)


:eek:???
 
@Kekox
next godieplx script :D, why are you setting positions twice as it's already in parameters?
Lua:
function onStepIn(cid, item, position, fromPosition)
local place = {x=1234, y=1234, z=7}
local storage = 1155
	if getPlayerStorageValue(cid, storage) ~= 1 then
		setPlayerStorageValue(cid, storage, 1)
		doTeleportThing(cid, place, FALSE)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can pass.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You've already been there.")
		doTeleportThing(cid, fromPosition, FALSE)
	end
return TRUE
end
 
@Kekox
next godieplx script :D, why are you setting positions twice as it's already in parameters?
Lua:
function onStepIn(cid, item, position, fromPosition)
local place = {x=1234, y=1234, z=7}
local storage = 1155
	if getPlayerStorageValue(cid, storage) ~= 1 then
		setPlayerStorageValue(cid, storage, 1)
		doTeleportThing(cid, place, FALSE)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can pass.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You've already been there.")
		doTeleportThing(cid, fromPosition, FALSE)
	end
return TRUE
end

You script seems to be easier, and clean.
rox.png
Thanks.
 
Back
Top