A
Alw
Guest
Hello, this is a very simple script which I'm going to release.
How does this script work and what does it do?
This script is used as a level-door but for teleports and tiles. If the player doesn't have the required level or are higher he will be sent back to the position he was before he tried to enter the tile or teleport. If he's high enough he will be able to enter the tile or be teleported to the right destination.
How to install it?
You simply make a new file in movements and copy the code, the you add it to movements.xml (code below).
How to use it?
You use it by adding the uid 8700 to any tile or teleport that you want this on. Then you add your required level + 1000 as actionid on your tile or teleport.
ex. I have a teleport that will teleport a player to a quest, but he needs to be atleast level 100.
I open my mapeditor then I add 8700(uid) to the teleport and after that i add 1100 on to action id (required level + 1000). If you're using a teleport(magic forcefield etc) then don't forget to write the destination on it as well.
Problems?
Just post a reply and I'll try to explain it more firmly.
Copy this code onto a new file in movements.
The copy this code to movements.xml (You can change the uid to whatever you like).
How does this script work and what does it do?
This script is used as a level-door but for teleports and tiles. If the player doesn't have the required level or are higher he will be sent back to the position he was before he tried to enter the tile or teleport. If he's high enough he will be able to enter the tile or be teleported to the right destination.
How to install it?
You simply make a new file in movements and copy the code, the you add it to movements.xml (code below).
How to use it?
You use it by adding the uid 8700 to any tile or teleport that you want this on. Then you add your required level + 1000 as actionid on your tile or teleport.
ex. I have a teleport that will teleport a player to a quest, but he needs to be atleast level 100.
I open my mapeditor then I add 8700(uid) to the teleport and after that i add 1100 on to action id (required level + 1000). If you're using a teleport(magic forcefield etc) then don't forget to write the destination on it as well.
Problems?
Just post a reply and I'll try to explain it more firmly.
Copy this code onto a new file in movements.
Code:
function onStepIn(cid, item, position, fromPosition)
local player = Player(cid)
local creature = Creature(cid)
if(item.actionid<2000 and item.actionid>1000) then
local levelReq = item.actionid-1000
if(player:getLevel() <= levelReq) then
creature:teleportTo(fromPosition, true)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be atleast level "..levelReq.." to enter.")
return false
end
end
return true
end
The copy this code to movements.xml (You can change the uid to whatever you like).
Code:
<movevent event="StepIn" uniqueid="UID" script="Name of script.lua"/>