Hi XxAwesomeDabxX.
Remember to add a wait() in the infinite loops. Otherwise it might not work, or even crash Studio.
local CollectionService = game:GetService("CollectionService")
local TaggedPart = CollectionService:GetTagged("spinning")
for _, TaggedPart in pairs(TaggedPart) do
while true do
TaggedPart.CFrame = TaggedPart.CFrame * CFrame.fromEulerAnglesXYZ(0.0,0.1,0.0)
wait(1) -- Replace 1 with the time you consider necessary.
end
end
If this still does not solve your problem, let me know.
Also if you are using “while wait() do” loops, I recommend looking at this post.
@XxAwesomeDabxX Try changing the name of the variable, like this:
(I have tried it and this works.)
local CollectionService = game:GetService("CollectionService")
local TaggedParts = CollectionService:GetTagged("spinning")
for _, TaggedPart in pairs(TaggedParts) do
while true do
TaggedPart.CFrame = TaggedPart.CFrame * CFrame.fromEulerAnglesXYZ(0.0,0.1,0.0)
wait(1) -- Replace 1 with the time you consider necessary.
end
end
Likewise, what you may be doing wrong is to assign the blocks their tag. I recommend using this plugin to do this.
You’re missing something. It’s only turning one part because the loop isn’t ending. Try this:
local CollectionService = game:GetService("CollectionService")
local TaggedParts = CollectionService:GetTagged("spinning")
while wait(1) do
for _, TaggedPart in pairs(TaggedParts) do
TaggedPart.CFrame = TaggedPart.CFrame * CFrame.fromEulerAnglesXYZ(0.0,0.1,0.0)
end
end
You could also do the method that you mentioned but with coroutines, but personally for me this is easier to understand.