This is my training system which I was using at tidia.pl
How does it work? It just takes x soul points per x seconds from x player when he is standing at special tile.
It looks like that:
So player has 100 soul points, every x seconds he is losing 1 soul points, when he's soul points will go less than 6 or 7 he will be kicked out and he won't be able to enter again untill he will get some soul points.
Globalevent:
Interval-> each 45 seconds player will lose soul point.
check.lua
Change local t, change the position where player should be kicked if he has not enough soul points to train.
Paste into movements:
Make storagereset.lua
and Make soulgate.lua
Now actionids
As you can see on the image, the place where im standing to attack the monk should be with actionid: 19755
The square right from me should be with actionid: 19756
I think its good option to don't let players bot 24/7 at trainers.
How does it work? It just takes x soul points per x seconds from x player when he is standing at special tile.
It looks like that:
So player has 100 soul points, every x seconds he is losing 1 soul points, when he's soul points will go less than 6 or 7 he will be kicked out and he won't be able to enter again untill he will get some soul points.
Globalevent:
Code:
<globalevent name="check" interval="45" event="script" value="check.lua"/>
check.lua
Code:
function onThink(pid, interval)
local t = {x=31879, y=32438, z=6}
for _, pid in ipairs(getPlayersOnline()) do
if getPlayerStorageValue(pid,23331) == 1 then
if getPlayerSoul(pid) > 5 then
doPlayerAddSoul(pid, -1)
else
setPlayerStorageValue(pid, 23331, -1)
doTeleportThing(pid, t)
doCreatureSay(pid, "You have no enought Soul Points to Train. Come back with more than 6 Soul Points.", TALKTYPE_ORANGE_1)
end
end
end
return true
end
Change local t, change the position where player should be kicked if he has not enough soul points to train.
Paste into movements:
Code:
<movevent type="StepIn" actionid="19755" event="script" value="storagereset.lua"/>
<movevent type="StepOut" actionid="19755" event="script" value="storagereset.lua"/>
<movevent type="StepIn" actionid="19756" event="script" value="soulgate.lua"/>
Make storagereset.lua
Code:
function onStepIn(cid, item, pos)
if (item.actionid == 19755) then
if (getPlayerStorageValue(cid, 23331) == -1) then
setPlayerStorageValue(cid, 23331, 1)
doCreatureSay(cid, "Training Started. Every 60 seconds you will loose 1 Soul Point.", TALKTYPE_ORANGE_1)
end
end
return TRUE
end
function onStepOut(cid, item, pos)
if (item.actionid == 19755) then
if (getPlayerStorageValue(cid, 23331) == 1) then
setPlayerStorageValue(cid, 23331, -1)
end
end
return TRUE
end
and Make soulgate.lua
Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerSoul(cid) < 6 then
doTeleportThing(cid, fromPosition, true)
doCreatureSay(cid, "You have no enought Soul Points, go hunt to get them.", TALKTYPE_ORANGE_1)
end
return true
end
Now actionids
As you can see on the image, the place where im standing to attack the monk should be with actionid: 19755
The square right from me should be with actionid: 19756
I think its good option to don't let players bot 24/7 at trainers.