Hi,
i'm greenhorn in lua (3 days of learning). I decided to post my first script - 100% by me.
[video=youtube;4QA8ot6jIYo]http://www.youtube.com/watch?feature=player_profilepage&v=4QA8ot6jIYo[/video]
Step 1
YourOTS\data\lib\050-function.lua | At the end, add this:
Step 2
YourOTS\data\talkactions\scripts\rainbowsys.lua | create and add this:
Step 3
YourOTS\data\talkactions\talkactions.xml | At the end, add this:
Plz, don't delete my footer. I'm sorry for my bad english ;s
Enjoy and rep me ++!
@down
yep, that's true. This script is only for very good dedicated servers... or acces only god/any support
i'm greenhorn in lua (3 days of learning). I decided to post my first script - 100% by me.
[video=youtube;4QA8ot6jIYo]http://www.youtube.com/watch?feature=player_profilepage&v=4QA8ot6jIYo[/video]
Step 1
YourOTS\data\lib\050-function.lua | At the end, add this:
Code:
czekaj = coroutine.yield
function czekanie(c)
if(coroutine.status(c) ~= 'dead') then
local _, czas = coroutine.resume(c)
addEvent(czekanie, czas, c)
end
end
function zacznijCzekac(f)
if(type(f) == 'function') then
local c = coroutine.create(f)
czekanie(c)
end
end
function timeString(timeDiff)
local dateFormat = {
{"day", timeDiff / 60 / 60 / 24},
{"hour", timeDiff / 60 / 60 % 24},
{"minute", timeDiff / 60 % 60},
{"second", timeDiff % 60}
}
local out = {}
for k, t in ipairs(dateFormat) do
local v = math.floor(t[2])
if(v > 0) then
table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
end
end
return table.concat(out)
end
Step 2
YourOTS\data\talkactions\scripts\rainbowsys.lua | create and add this:
Code:
function onSay(cid, words, param)
--config ## Script By Dubler from otland.net ##
local t = 5 -- time in seconds
local fr = 4 -- frequency, changes per second
--endconfig ## Script By Dubler from otland.net ##
local frequency = (1000 / fr)
local timevar = (fr * t)
zacznijCzekac(function()
for i = 1, timevar do
cc(cid)
czekaj(frequency)
local i = (i + 1)
end
end)
return true
end
function cc(cid)
local head = math.random(133)
local body = math.random(133)
local legs = math.random(133)
local feet = math.random(133)
local myOutfit = getCreatureOutfit(cid)
local outfit = {lookType = myOutfit.lookType, lookHead = head, lookAddons = myOutfit.lookAddons, lookLegs = legs, lookBody = body, lookFeet = feet}
doSetCreatureOutfit(cid, outfit, (frequency +5))
end --## Script By Dubler from otland.net ##
Step 3
YourOTS\data\talkactions\talkactions.xml | At the end, add this:
Code:
<talkaction words="/rainbow" event="script" value="rainbowsys.lua"/>
Plz, don't delete my footer. I'm sorry for my bad english ;s
Enjoy and rep me ++!
@down
yep, that's true. This script is only for very good dedicated servers... or acces only god/any support
Last edited: