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

Challenge for skilled scripter!

FLE

Member
Joined
Oct 5, 2008
Messages
422
Reaction score
24
Location
Vancouver Canada
Hey im looking for a script that will push a player back to x location if they try to enter y portal...


The point of the portal is to prevent botting in my new players area... where it is non pvp.....

and maybe even a script that will kick the player from the noob area when he reaches a certain level?
 
Although i don't really get what you want this for, since this will stop all players from entering the portal, but here you go lol

Lua:
function onStepIn(cid, item, position, fromPosition)

config = {

pushback_position = {x=, y=, z=}
}

doTeleportThing(cid, config.pushback_position)
doSendMagicEffect(pushback_position, 10)
end
 
Lua:
function onStepIn(cid, item, position, fromPosition)

	if getPlayerStorageValue(cid, x) == nil then
		doTeleportThing(cid, fromPosition)
		doCreatureSay(cid, "You cannot enter here.", TALKTYPE_ORANGE_1)
	end
	return TRUE
end

The other script (the thing of the level)...
Lua:
local levelLimit = 100
local fromPosition = { x = 100, y = 100, z = 7 }
local toPosition = { x = 150, y = 150, z = 7 }
local newPosition = { x = 50, y = 50, z = 7 }


function onAdvance(cid, skill, oldlevel, newlevel)

	if(skill == SKILL__LEVEL) then
		if(getPlayerLevel(cid) >= levelLimit and isInArea(getCreaturePosition(cid), fromPosition, toPosition)) then
			doTeleportThing(cid, newPosition)
		end
	end
	return TRUE
end
 
hey guys, can u explain a little more how to use these 2 scripts.

and btw thanks, they look great!


like movements/actions .. please and thank you, but im amazed the script looks exactly wat im looking for :p

you're good :) :) !
 
Create a file called tp_back.lua in data/movements/scripts and add this:
Lua:
function onStepIn(cid, item, position, fromPosition)

	if item.actionid == 12000 then
		if getPlayerStorageValue(cid, 65535) == nil then
			doTeleportThing(cid, fromPosition)
			doCreatureSay(cid, "You cannot enter here.", TALKTYPE_ORANGE_1)
		end
		return TRUE
	end
	return TRUE
end

Add this to data/movements/movements.xml
Lua:
    <movevent type="StepIn" actionid="12000" event="script" value="tp_back.lua"/>

Explain: If player try to enter in a teleport (with actionid 12000) and if he does not have a storage (65535) then he can't enter.

Other script
Create a file called level_tp.lua in data/creaturescripts/scripts and add this:
Lua:
  local levelLimit = 100
local fromPosition = { x = 100, y = 100, z = 7 }
local toPosition = { x = 150, y = 150, z = 7 }
local newPosition = { x = 50, y = 50, z = 7 }


function onAdvance(cid, skill, oldlevel, newlevel)

        if(skill == SKILL__LEVEL) then
                if(getPlayerLevel(cid) >= levelLimit and isInArea(getCreaturePosition(cid), fromPosition, toPosition)) then
                        doTeleportThing(cid, newPosition)
                end
        end
        return TRUE
end

Add this to data/creaturescripts/creaturescripts.xml
Lua:
	<event type="advance" name="LevelTP" event="script" value="level_tp.lua"/>

Now add this in data/creaturescript/scripts/login.lua
(Under function onLogin(cid))
Lua:
registerCreatureEvent(cid, "LevelTP")

Explain: If player reaches the level limit(100) and is in an area (noobArea) then he will be teleported to other position

Lua:
local fromPosition = { x = 100, y = 100, z = 7 } --from position of the area
local toPosition = { x = 150, y = 150, z = 7 } --to position of the area
local newPosition = { x = 50, y = 50, z = 7 } --position where the player will be teleported

Example:
mux3dj.jpg
 
Back
Top