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

TalkAction Diffrent Dice

Wazzap

Killing Elite
Joined
Jun 15, 2010
Messages
124
Reaction score
4
Location
London / Poland
Diffrent Dice
Los by !los
http://img714.imageshack.us/img714/199/losowanie.jpg


data/talkactions/scripts/losowanie.lua

function onSay(cid, words, param)
local effect = 12 -----numer efektu
local textColor = 192 ----numer koloru wyświetlanej liczby
if(param ~= '' and tonumber(param) > 0) then
doSendAnimatedText(getCreaturePosition(cid),math.random(1,param),textColor)
doSendMagicEffect(getCreaturePosition(cid),12)
else
doPlayerSendTextMessage(cid,22,"Musisz podac liczbe wieksza od 0")
end
return TRUE
end

talkactions.xml:
<talkaction words="!los" event="script" value="losowanie.lua"/>
]
 
Code:
21/06/2010 13:11:37] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/losowanie.lua:5: ')' expected near 'andom'
[21/06/2010 13:11:37] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/losowanie.lua)
[21/06/2010 13:11:37] data/talkactions/scripts/losowanie.lua:5: ')' expected near 'andom'

TFS 0.3.6
 
@up
TFS 0.3.6 = Tibia 8.54
and here I did a very small change:
LUA:
function onSay(cid, words, param)
local effect = 12 -----numer efektu
local textColor = 192 ----numer koloru wyswietlanej liczby
	if param == '' then
		doSendAnimatedText(getCreaturePosition(cid),math.random(1,6),textColor)
		doSendMagicEffect(getCreaturePosition(cid),effect)
	elseif tonumber(param) > 0 then
		doSendAnimatedText(getCreaturePosition(cid),math.random(1,param),textColor)
		doSendMagicEffect(getCreaturePosition(cid),effect)
	end	
return true
end
 
Back
Top