How do I change the property of v if v is a part?

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

1 Like

I think its BrickColor with a capitalised c

1 Like

How I make a sound play only once in an if statment? here is my code:

if v.BrickColor == ("Lime green") then
    print("Cannot play Checkpoint sound, Brick color is not equal to Lime green")
else
	sound:Play()
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
2 Likes

glad it worked
\\\\\\\\\

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.