Hello! I am making a game where you have different levels and you need to beat, you have touch every collectible that’s in the level to pass to the next…
The problem is that, I have a block that you need to touch to pass to the next level and it checks if you have all of the collectibles. If you do it becomes green and if not then it becomes red. But it just don’t works and it has happened to me in multiple occations
This is the code for the part:
script.Parent.Touched:Connect(function()
if game.ReplicatedStorage.LightValue.Value <= 5 then
script.Parent.BrickColor = BrickColor.new("Really red")
end
end)
script.Parent.Touched:Connect(function()
if game.ReplicatedStorage.LightValue.Value >= 5 then
script.Parent.BrickColor = BrickColor.new("Lime green")
end
end)
Here’s a screenshot from studio:
I would appreciate some help!