Hello,
I've made a jail system:
~When you get a RS you go to the jail
~When RS over, you are teleported to the temple
~Thanks to Renusek for help :*
So:
Creaturescripts.xml
login.lua
jail.lua
jailn.lua
Greetings
I've made a jail system:
~When you get a RS you go to the jail
~When RS over, you are teleported to the temple
~Thanks to Renusek for help :*
So:
Creaturescripts.xml
XML:
<event type="think" name="JailByErexo" event="script" value="jail.lua"/>
<event type="think" name="JailByErexon" event="script" value="jailn.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "JailByErexo")
registerCreatureEvent(cid, "JailByErexon")
jail.lua
Lua:
function onThink(cid, interval)
rand = math.random(1,4)
if getCreatureSkullType(cid) == SKULL_RED then
if not isInRange(getThingPos(cid), {x = 1102, y = 824, z = 7}, {x = 1151, y= 874, z = 7}) then -- Jail
if rand == 1 then
doTeleportThing(cid, {x = 1143, y = 836, z = 7}, true) -- First cell
elseif rand == 2 then
doTeleportThing(cid, {x = 1147, y = 851, z = 7}, true) -- Second cell
elseif rand == 3 then
doTeleportThing(cid, {x = 1119, y = 851, z = 7}, true) -- Third cell
elseif rand == 4 then
doTeleportThing(cid, {x = 1132, y = 867, z = 7}, true) -- Fourth cell
end
end
end
return TRUE
end
jailn.lua
Lua:
function onThink(cid, interval)
if getPlayerGroupId(cid) <= 2 then -- GM can "visit" a jail
if getCreatureSkullType(cid) == SKULL_NONE then
if isInRange(getThingPos(cid), {x = 1102, y = 824, z = 7}, {x = 1151, y= 874, z = 7}) then -- Jail
doTeleportThing(cid, {x = 1018, y = 478, z = 6}, true) -- Pos to tel after RS remove
end
end
end
return TRUE
end
Greetings
Last edited: