Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Looping spinning stuff looking weird/not working right?

Asked by 6 years ago

Alright, so I'm trying to make this thing where it copies something from the lighting folder, slowly fades in using transparency and spins while doing so, hoping to do it so then it faces the original way (which I found while looping it 10 times was a value of 40 using part.rotation = Vector3.new(0,40,0)). It does each part individually which is what I wanted but, whenever it goes to the next object it keeps adding another 40 to the startup. I am very new to Roblox Lua, not to mention any kind of Lua. But I am starting to think that there is something better to use. As each time I think I'm getting close, it all just either points in the same direction, or just breaks.

x = game.Lighting.GroupedObject1:Clone()
children = x:GetChildren()
x.Parent = game.Workspace
children.Transparency = 1
for i=1,#children do
    child = children[i]
    child.Transparency = 1  
end
for j=1,#children do
    child=children[j]
    spin = child.Orientation
    for h =1,10 do
        child.Transparency = child.Transparency - 0.1
        child.Orientation = Vector3.new(0,spin,0)
        spin = spin+20
        wait()
end
end
end

I'll be honest with you all, I don't know Lua. I know python and I'm just googling and asking questions on how to do all the stuff that should work or the stuff I need to use.

Any help towards solving this problem will be appreciated. ~SSL

0
Use CFrame.FromEulerAnglesXYZ, it's way better than orientation. Plus, orientation will make the object go ontop of the object ontop of it. CFrame.new(0,0,0) = CFrame.new(0,0,0) * CFrame.FromEulerAnglesXYZ(0,0,0) User#22722 20 — 6y
0
line 4 tries to set a table transparent the8bitdude11 358 — 6y

Answer this question