Go Back   OtLand > Resources > Lua & XML > Requests & Support

Reply
Old 25th June 2009, 22:34   #1 (permalink)
FLE
Senior Member
 
FLE's Avatar
 
Join Date: Oct 2008
Location: Vancouver Canada
Posts: 203
Reputation: FLE is on a distinguished road



Challenge for skilled scripter!

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?
FLE is offline   Reply With Quote
Old 25th June 2009, 23:08   #2 (permalink)
kokokoko
Senior Member
 
Join Date: Feb 2008
Posts: 620
Blog Entries: 2
Reputation: kokokoko is a jewel in the roughkokokoko is a jewel in the roughkokokoko is a jewel in the roughkokokoko is a jewel in the rough



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 Code:
function onStepIn(cid, item, position, fromPosition)

config = {

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

doTeleportThing(cid, config.pushback_position)
doSendMagicEffect(pushback_position, 10)
end
__________________
Feel free to REP++ me if i helped you!
kokokoko is offline   Reply With Quote
Old 25th June 2009, 23:11   #3 (permalink)
darkhaos
Needing ideas for scripts
 
darkhaos's Avatar
 
Join Date: Apr 2008
Location: Venezuela
Posts: 750
Reputation: darkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to all



Lua Code:
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 Code:
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
__________________

darkhaos is offline   Reply With Quote
Old 26th June 2009, 18:06   #4 (permalink)
FLE
Senior Member
 
FLE's Avatar
 
Join Date: Oct 2008
Location: Vancouver Canada
Posts: 203
Reputation: FLE is on a distinguished road



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 !
FLE is offline   Reply With Quote
Old 29th June 2009, 13:49   #5 (permalink)
darkhaos
Needing ideas for scripts
 
darkhaos's Avatar
 
Join Date: Apr 2008
Location: Venezuela
Posts: 750
Reputation: darkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to alldarkhaos is a name known to all



Create a file called tp_back.lua in data/movements/scripts and add this:
Lua Code:
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 Code:
    <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 Code:
  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 Code:
        <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 Code:
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 Code:
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:
__________________

darkhaos is offline   Reply With Quote
Old 29th June 2009, 13:53   #6 (permalink)
Master-m
Kiper pwnz
 
Join Date: May 2007
Location: The Netherlands
Posts: 4,560
Reputation: Master-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond reputeMaster-m has a reputation beyond repute



Send a message via MSN to Master-m
You need to only place a teleport without coordinates and teleport using lua. Else it will bug big..
__________________
Having problems to understand myself sometimes.
Give me some reputation if my post helped you ;)(also add your name please)


Master-m is offline   Reply With Quote
Old 1st July 2009, 03:37   #7 (permalink)
FLE
Senior Member
 
FLE's Avatar
 
Join Date: Oct 2008
Location: Vancouver Canada
Posts: 203
Reputation: FLE is on a distinguished road



Hey thanks so much man this is so pro

repped+!
FLE is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 14:12.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO
Copyright ©2007 - 2010, OtLand.net.