• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Add item when record of players

Andy Man

Advanced OT User
Joined
Jun 15, 2011
Messages
1,689
Reaction score
194
Location
México
When you break a record of players this will give everyone an item,

Code:
function onRecord(current, old, cid)
doPlayerSendTextMessage(cid,21,"We just made a new record so here you have an item!")
doPlayerAddItem(cid,2493,1)   
for a = 1,10
end

You can change ID at,

Code:
doPlayerAddItem(cid,2493,1)
 
Last edited:
Well when theirs a record of players (lets say max players where 150 players) and now they're 151 new record you get an item.

It will only add to the one that executes the script(none), not everyone on the server?

Lua:
function onRecord(current, old, cid)
	for _, name in ipairs(getOnlinePlayers()) do
		local cid = getPlayerByName(name)
		doPlayerAddItem(cid, 2493, 1)
	end
	doBroadcastMessage("We have just reached "..current.." players.")
	return true
end
I don't know something like this?
But it'll only add to players that are online, which is essentially what we're after?
 
Last edited:
It will only add to the one that executes the script(none), not everyone on the server?

function onRecord(current, old, cid)
That means when record.

Well, I'm new in scripting but I thought it will give it to everyone, I just learned how to script like 2 hours ago.
 
function onRecord(current, old, cid)
That means when record.

Well, I'm new in scripting but I thought it will give it to everyone, I just learned how to script like 2 hours ago.

Yes but it will only give to cid, creature id that executed the script.
So you need to get all players and give them item.
So for that you need a loop.
 
As it stayed the script and he this functioning? It is in the libs that I put? Please, who me of the some light?
 
Could be devistational to a server that's just opening. the first player online that stays online botting in trainers or whatever will get an item EVERY time a new player logs in, you should make it so that it doesn't start until there are 100~ players online.
 
Back
Top