Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make the second 'I' 2 less than the first??

local children = workspace.Track:GetChildren()
for i = 1, #children do 
local child = children[i]
print("local tween"..i.." = ts:Create(part2,Tweeninf,move"..i-2..")")
end

Basically I want the I after the move part to be two less than the I after the tween part but this won't work :/ Any idea how to make it work??

2 comments

0

then do i = move.Part, stupid

1

dude stop saying stupid in every comment you make.

1 answer

Just make a new variable

local children = workspace.Track:GetChildren()
    for i = 1, #children do 
        local child = children[i]
        new_i = i - 2
        print("local tween"..i.." = ts:Create(part2,Tweeninf,move"..new_i..")")
end

This discussion is preserved as it was. New answers, comments, and votes are closed.