Baalzephom
Member
I need a script something like this, If a player is not a Sorcerer cant pass X sqm
Please is urgent
Please is urgent
<movevent type="StepIn" actionid="20001" event="script" value="voctile.lua"/>
function onStepIn(cid, item, pos)
------------
-- Config --
------------
local tilepos = {x = 556, y = 31, z = 7, stackpos = 1} -- The position of the "Voc" Tile.
local acceptpos = {x = 528, y = 156, z = 8, stackpos = 1} -- Accepted position.
local rejectpos = {x = 556, y = 35, z = 7, stackpos = 1} -- Rejected position.
local vocations = {2,3,4,6,7,8} -- Vocations that can pass. In this case I removed Sorcerer/Master Sorcerer like you asked.
function RejectPlayer()
doTeleportThing(cid, rejectpos)
doSendMagicEffect(tilepos, 2)
doPlayerSendCancel(cid, "Sorry, your vocation is not allowed to pass!")
end
------------
-- Script --
------------
if isInArray(vocations, getPlayerVocation(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Go on!")
doTeleportThing(cid, acceptpos)
doSendMagicEffect(tilepos, 6)
else
RejectPlayer()
end
return 1
end
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
if isSorcerer(cid) == FALSE then
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid, "Only sorcerer can pass.")
end
end
return TRUE
end
is not needed xP<movevent type="StepOut" actionid="20001" event="script" value="voctile.lua"/>
@Guitar
Nice script, but it:
is not needed xP
Cya!
Hmm this is not the requests sub-forum but well.
This script is simplified from one of mine, I didnt test it but should work because I only removed stuff from my working one.
Add this in movements.xml:
PHP:<movevent type="StepIn" actionid="20001" event="script" value="voctile.lua"/>
Put the actionID you desire there, and on the tile of course.
And now make the file voctile.lua (on data/movements/scripts) and add this in it:
LUA:function onStepIn(cid, item, pos) ------------ -- Config -- ------------ local tilepos = {x = 556, y = 31, z = 7, stackpos = 1} -- The position of the "Voc" Tile. local acceptpos = {x = 528, y = 156, z = 8, stackpos = 1} -- Accepted position. local rejectpos = {x = 556, y = 35, z = 7, stackpos = 1} -- Rejected position. local vocations = {2,3,4,6,7,8} -- Vocations that can pass. In this case I removed Sorcerer/Master Sorcerer like you asked. function RejectPlayer() doTeleportThing(cid, rejectpos) doSendMagicEffect(tilepos, 2) doPlayerSendCancel(cid, "Sorry, your vocation is not allowed to pass!") end ------------ -- Script -- ------------ if isInArray(vocations, getPlayerVocation(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Go on!") doTeleportThing(cid, acceptpos) doSendMagicEffect(tilepos, 6) else RejectPlayer() end return 1 end
Regards.