• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua, creaturescripts - Broadcast when player got storage

adamox223

New Member
Joined
Oct 21, 2017
Messages
100
Reaction score
4
Hello, i need script for my ot, when player got storage: 2000, 100 then broadcast on screen: "player xxxx done quest, Congratulations!"

Can anyone help me?

Tfs 0.3.6
 
creaturescripts.xml
XML:
<event type="think" name="NAME" event="script" value="HERE NAME.lua"/>

creaturescripts->scripts->login.lua
LUA:
registerCreatureEvent(cid, "NAME")

LUA:
function onThink(cid, interval)
local storage = 2000
local value = 100
      if getPlayerStorageValue(cid, storage) == value then
           doBroadcastMessage('Player '..getCreatureName(cid)..' done quest, Congratulations!')
setPlayerStorageValue (cid, storage, 0)
   end
   return true
end
 
Last edited:
creaturescripts.xml
XML:
<event type="think" name="NAME" event="script" value="HERE NAME.lua"/>

creaturescripts->scripts->login.lua
LUA:
registerCreatureEvent(cid, "NAME")

LUA:
function onThink(cid, interval)
local storage = 2000
local value = 100
      if getPlayerStorageValue(cid, storage) == value then
           doBroadcastMessage('Player '..getCreatureName(cid)..' done quest, Congratulations!')
   end
   return true
end
That will spam the broadcast, you should reset the storage after execution.
 
Edited

That will spam the broadcast, you should reset the storage after execution.
Yea thats right.
I looked exactly what he wrote and I didnt think about anything else.

Generally it is a fuck shit. No functions like onAdvance for storage .....
 
That will spam the broadcast, you should reset the storage after execution.
well reseting the storage would make it possible for the player to do the quest again?

Anyway would be better to set the storage to 101 when the msg has been broadcasted

LUA:
setPlayerStorageValue (cid, storage, value+1)
 
well reseting the storage would make it possible for the player to do the quest again?

Anyway would be better to set the storage to 101 when the msg has been broadcasted

LUA:
setPlayerStorageValue (cid, storage, value+1)
Changing the value other than 100 would be I am sure a desired result.
 
Back
Top