i found out that roblox has wind properties
decided to look up example code to create random wind cycles
roblox has basic code for this
i modify, make gusts completely random
want to do the same for base wind
local gustCycleDelay = 4
local gustCycleDuration = 3.5
local r_valx = math.random(1, 15)
local r_valy = math.random(2, 5)
local r_valz = math.random(1, 15)
local baseWind = Vector3.new(r_valx, 0, r_valz)
local gust = Vector3.new(r_valx, r_valy, r_valz)
local gustIntervals = 100
local dg = gustCycleDuration / gustIntervals
local dgf = dg / gustCycleDuration
workspace.GlobalWind = baseWind
task.wait(gustCycleDelay)
while true do
for i = 1, gustIntervals do
local f = math.sin(math.pi * dgf * i)
workspace.GlobalWind = baseWind + f * gust
task.wait(dg)
end
workspace.GlobalWind = baseWind
task.wait(math.random() * gustCycleDelay)
end
code is above
i’m very new to boblox lua, and my goal with this script is to make it so wind is completely random, and ever changing, just like how a super windy & stormy area would be
i can’t seem to figure it out, any idea how i could do it?
i seem to be getting different syntax errors depending on where i put the function, but they all turn out to be the same issue; expects one thing, gets something different.