bodycarcoo11
Mapper
Hello And Welcome I WIll Show You How To Make Rain System First Of All Add This Code Into GlobalEvents.xml
The Path Of IT ../Data/GlobalEvents/Globalevents.xml
XML Code:
And Now The Lua Script
Path ../data/globalevents/scripts/rain.lua
And Done Now Hard Have Fun
The Path Of IT ../Data/GlobalEvents/Globalevents.xml
XML Code:
Code:
<globalevent name="rain" interval="-1" script="rain.lua"/>
Path ../data/globalevents/scripts/rain.lua
Code:
local rain = Rain:new()
function onThink(interval, lastExecution)
local minX = 949
local minY = 965
local maxX = 1069
local maxY = 1020
local frompos = {x=math.random(minX, maxX), y=math.random(minY, maxY), z=7}
local topos = {x=math.random(frompos.x, maxX), y=math.random(frompos.y, maxY), z=7}
local effects = {
snow = {
disteffect = CONST_ANI_FIRE,
effect = CONST_ME_FIREAREA
},
rain = {
disteffect = CONST_ANI_ICE,
effect = CONST_ME_WATERSPLASH
}
}
random = math.random(0, 10)
if (random == 0) then
rain.chance = math.random(10,50)
rain:start({fromPos = frompos, toPos = topos}, effects.snow, 300, math.random(100, 500))
else
rain.chance = math.random(40,100)
rain.createItem = {chance = math.random(0,10), item = {itemid = 2016, type = 1}}
rain:start({fromPos = frompos, toPos = topos}, effects.rain, math.random(300, 1000), math.random(100, 350))
end
return TRUE
end