Hello otland!
I use: The Forgotten Server - Edited By Cyko V8, version 0.3.6 - Edited By Cyko V8 (Crying Damson - Edited By Cyko V8)
I need help with this script:
I want this script to remove 100x of item 5865 when you enter the teleport but not if you access the door within 1 hour.
So if you walk into the teleport 01.32 it will charge you 100x of item 5865 but will not cost you anything until 02.32 1 hour countdown until you most pay again.
I have no idea how to edit .lua scripts so i would appreciate your help alot!
Thank you for reading my thread!
#edit:
Also, how do i make item 5865 collected in 1 slot of 100x max like crystal coins? Thanks again!
#SOLUTION by Limos:
I use: The Forgotten Server - Edited By Cyko V8, version 0.3.6 - Edited By Cyko V8 (Crying Damson - Edited By Cyko V8)
I need help with this script:
Code:
local tibleId = 5865
local pos = {x=923, y=1043, z=7}
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
if getPlayerItemCount(cid, tibleId) >= 100 then
doTeleportThing(cid, pos, TRUE)
doSendMagicEffect(pos, 10)
else
doTeleportThing(cid, fromPosition, TRUE)
doSendMagicEffect(position, 10)
end
end
return TRUE
end
I want this script to remove 100x of item 5865 when you enter the teleport but not if you access the door within 1 hour.
So if you walk into the teleport 01.32 it will charge you 100x of item 5865 but will not cost you anything until 02.32 1 hour countdown until you most pay again.
I have no idea how to edit .lua scripts so i would appreciate your help alot!
Thank you for reading my thread!
#edit:
Also, how do i make item 5865 collected in 1 slot of 100x max like crystal coins? Thanks again!
#SOLUTION by Limos:
Code:
local pos = {x=923, y=1043, z=7}
local storage = 38745
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) then
if exhaustion.check(cid, storage) then
doTeleportThing(cid, pos)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have "..math.floor(exhaustion.get(cid, storage)/60).." minutes left before you need to pay 100 juice coins again.")
return true
end
if doPlayerRemoveItem(cid, 5865, 100) then
doTeleportThing(cid, pos)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have paid 100 juice coins and can now enter for 1 hour.")
exhaustion.set(cid, storage, 60 * 60)
else
doTeleportThing(cid, fromPosition)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doPlayerSendCancel(cid, "You need 100 juice coins to enter.")
end
end
return true
end
Last edited: