local config = {
soundName = "sounds/Centralplains.wav",
tileId = 103,
storage = 55000,
musicTime = 118, --em segundos
musicTimeStorage = 91821
}
function onStepIn(cid, item, frompos, item2, topos)
if not isPlayer(cid) then return true end
if getPlayerStorageValue(cid, config.storage) < 1 then
if getPlayerStorageValue(cid, config.musicTimeStorage) > os.time() then
return setPlayerStorageValue(cid,config.storage,1)
else
doPlayerSendTextMessage(cid, 26, config.soundName)
setPlayerStorageValue(cid, config.storage, 1)
setPlayerStorageValue(cid, config.musicTimeStorage, os.time() + config.musicTime)
end
end
end
function onStepOut(cid, item, frompos, item2, topos)
if not isPlayer(cid) then return true end
if getPlayerStorageValue(cid, config.storage) == 1 and item2.itemId ~= config.tileId then
setPlayerStorageValue(cid, config.storage, -1)
end
end







info
Grupo: Cavaleiro
Registrado: 21/06/12
Posts: 155
Reputação: +3
Pessoas, o char do xtibia (Wuva)
me fez um script, o script basicamente é assim:
Você pisa no chão e ele te manda um som, eu usei esse system:
bem, mas um bug que ocorre:
toda vez que eu player andar sobre o piso que eu escolhi pra mandar o som, vai sempre mandar o som toda vez toda vez.... e vai ficar um som doido, tem alguma forma de o script verificar se o som ja está sendo executado... e não mandar o som
o script que ele fez foi esse: local config = { soundName = "sounds/Centralplains.wav", tileId = 103, storage = 55000, } function onStepIn(cid, item, pos, fromPos) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, config.storage) < 1 then doPlayerSendTextMessage(cid, 26, config.soundName) setPlayerStorageValue(cid,config.storage,1) end end function onStepOut(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, config.storage) == 1 and getTileItemById(position, config.tileId).uid <= 0 then setPlayerStorageValue(cid, config.storage, -1) end end, e quebrando o mito de que só se pode criar esse script usando coordenadas, ou action e unick id's no remeres...