I have a folder of parts and I want to change one of the parts in the folder once the player touches that specific part. How can I do that?
Here is my code:
local CheckpointsFolder = game.Workspace.CheckpointsFolder
for i, v in pairs (CheckpointsFolder:GetChildren()) do
v.Touched:Connect(function(hit)
-- v.Brickcolor???? (doesnt work)
end)
end
if the sound keeps on playing check in its properties if its looped, or just use this version
if v.BrickColor == ("Lime green") then
print("Cannot play Checkpoint sound, Brick color is not equal to Lime green")
else
sound:Play()
task.wait(sound.TimeLength)
sound:Stop()
end