-
What do you want to achieve?
I have a table with conditions in a table that check if 6 tool’s (the tool’s handles) positions match a 6 other parts; positions in the game. If the 6 tools’ positions match the 6 parts’ positions then when I click my button part it should turn transparent. -
What is the issue?
The issue is that even though the 6 tool’s positions do not match the 6 part’s positions, my button part still goes transparent. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried to put the specific position coordinates like this "game.Workspace.Comic2Tool.Handle.Position == Vector3.new(x,y,z) instead but that didn’t change anything and the script worked the same way. BTW I am new to using tables/arrays so I’m not sure if I am doing this right!
local ClickDetector = script.Parent.ClickDetector
function onMouseClick(player)
local Conditions =
{game.Workspace.Comic1Tool.Handle.Position == game.Workspace.ComicPlacement1.Position,
game.Workspace.Comic2Tool.Handle.Position == game.Workspace.ComicPlacement2.Position,
game.Workspace.Comic3Tool.Handle.Position == game.Workspace.ComicPlacement3.Position,
game.Workspace.Comic4Tool.Handle.Position == game.Workspace.ComicPlacement4.Position,
game.Workspace.Comic5Tool.Handle.Position == game.Workspace.ComicPlacement5.Position,
game.Workspace.Comic6Tool.Handle.Position == game.Workspace.ComicPlacement6.Position}
if Conditions then
script.Parent.Transparency = 1
print("Correct!")
end
end
ClickDetector.MouseClick:Connect(onMouseClick)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.