Hello, I have a problem where once you touched one of the checkpoints, all the other checkpoints do the same tween. Once all the tweens play, you cannot activate it once more.
My question is:
How do you tween one object if you've got all children from a model or folder?
I have provided code:
for _, v in pairs(workspace.StagePoints:GetChildren()) do v.Touched:Connect(function(hit) if v ~= nil then if v.Parent == workspace.StagePoints then local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
local parts = workspace.StagePoints:GetChildren()
if player then
if player.leaderstats.Stage.Value == tonumber(v.Name) - 1 then
player.leaderstats.Stage.Value += 1
player.TeleportedStage.Value = player.leaderstats.Stage.Value
for i = 1, #parts do
local Tween = game.TweenService:Create(parts[i],TweenInfo.new(0.8,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Size = Vector3.new(6, 0.5, 6); Transparency = 1})
local animatedPart = parts[i].Animated
animatedPart.Transparency = 0
Tween:Play()
wait(1.2)
animatedPart.Size = Vector3.new(4, 0.25, 4)
end
end
end
end
end
end)
end
I really need help with this because I've been trying to figure out how to do this for the past days.
