What is the issue?
script fires multipie times depend on amount of leave part
What solutions have you tried so far?
I tried to slove it via forum,but no progress yet
local collectionservice = game:GetService("CollectionService")
local Leave = collectionservice:GetTagged("Leaves")
for _,v in pairs(Leave) do
local leaves = v
print(leaves)
v.Position = Vector3.new(v.Position.x, v.Position.y-0.2, v.Position.z)
x = 0
z = 0
T = -99999
tall = leaves.Size.Y / 2
math.randomseed(tick())
rand = (math.random(0,20))/10
task.spawn(function()
while true do
x = leaves.Position.x + (math.sin(T + (leaves.Position.x/5)) * math.sin(T/9))/10
z = leaves.Position.z + (math.sin(T + (leaves.Position.z/9)) * math.sin(T/18))/6
leaves.CFrame =
CFrame.new(x, leaves.Position.y, z) * CFrame.Angles((z-leaves.Position.z)/tall, 0,(x-leaves.Position.x)/-tall)
wait()
T = T + 0.12
end
end)
end