Alyhide
Banned User
How would I put..
in..
LUA:
if getPlayerStorageValue(cid, exhaustStorage) < os.time() then
setPlayerStorageValue(cid, exhaustStorage, os.time() + (exhaustTime * 60))
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
in..
LUA:
local exhaustStorage = 24022
local exhaustTime = 1 --Minutes
local scroll = 1949 --Item ID of Scroll or Writeable Object
local places = {
['temple'] = {x=3000,y=2098,z=7},
['teleports'] = {x=2815,y=2025,z=7},
['addons'] = {x=1266,y=880,z=7},
['addon bosses'] = {x=1127,y=907,z=6},
['trainers'] = {x=2877,y=2005,z=7},
['donation quest'] = {x=3160,y=1572,z=7},
['shops'] = {x=2940,y=2075,z=7},
['sailors quarter'] = {x=3010,y=2192,z=6},
}
function onTextEdit(cid, item, newText)
if item.itemid ~= scroll or getPlayerItemById(cid, true, scroll).uid ~= item.uid then
return true
end
if isPlayerPzLocked(cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_PLAYERISPZLOCKED)
return true
end
if isInArray({'locations','location','place','places'},newText:lower()) then --Words to be said to get list of places.
local i = ''
for j, k in pairs(places) do
i = i .. ' [' .. j .. ']'
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Current Teleportation Locations: ' .. i) --When player says location.
return true
end
if not places[newText:lower()] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Invalid location. Please write Locations in the paper to see a list of the current locations.') --If Invalid Location.
return true
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have been teleported to your location. Please wait one minute before teleporting again.' .. i) --When teleported.
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, places[newText:lower()])
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
return true
end
Last edited: