-
What do you want to achieve? Keep it simple and clear!
I want a part to become transparent when I click it only when all the values in a table are true when I click on the part. -
What is the issue? Include screenshots / videos if possible!
The issue is that the part will become transparent when clicked even if the conditions in my table WERE true but no longer true. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried to change the table conditions to other things like part postions but that doesnt change my issue. The script will still turn my part transparent on click as long as the conditions in the table ARE or WERE true, but I want it to only work when the conditions are currently true.
local ClickDetector = script.Parent.ClickDetector
function onMouseClick(player)
local Conditions =
{game.Workspace.Comic1Tool.PlacementCheck.Value,
game.Workspace.Comic2Tool.PlacementCheck.Value}
for i,v in Conditions do
if v == true then
script.Parent.Transparency = .5
end
end
end
ClickDetector.MouseClick:Connect(onMouseClick)
PlacementCheck is a BoolValue and the Value is only true when the parent, a tool, is on a certain position. And my table is supposed to check for when these BoolValues are enabled for my function to work.