• 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!

Solved Storage Increment

Acubens

Old Penguin
Joined
May 6, 2008
Messages
1,303
Solutions
15
Reaction score
218
Location
Venezuela
I have making my own football script, how i can do work my globalstorage increment?

Example:


LUA:
if gol is true then
globalStorageIncrement
text "Player Blabla have 1+ goal"
end
 
Last edited:
maybe like, make onAddItem for the football id? and then put actionids on goal tiles.
Code:
function onAddItem(moveItem, tileItem, position, cid)

	if isPlayer(cid) and isInArray({20001, 20002}, tileItem.actionid)then
		doBroadcastMessage(getCreatureName(cid) .. ' scored a goal for Team ' .. (tileItem.actionid == 20001 and 'B' or 'A') .. '!')
		setGlobalStorageValue(tileItem.actionid, math.max(1, getGlobalStorageValue(tileItem.actionid) + 1))
		-- code to reset ball, etc!?
	end
	
end
 
Back
Top