#im new to roblox studio and i need help to make a button system where when you click all buttons it
30 messages · Page 1 of 1 (latest)
nono
You need to click 5 buttons and once you click all of them a door will open so yeah basically
with a click detecter
oh thats not too bad
You think you can help?
** You are now Level 1! **
basically what you need to do is store all of the buttons in a table and keep track of whether or not they have been pressed using another table.
yeah i was looking at something rq
also my bad it doesnt ened 2 tables, just 1 dictionary
an instance can be used as a key to a table, that is important
local buttons = {}
local buttonsPressed = {}
local function AreAllDown()
for _, pressed in buttonsPressed do
if not pressed then
return false
end
end
return true
end
for _, button in buttons do
buttonsPressed[button] = false
button.MouseButton1Click:Connect(function()
buttonsPressed[button] = true
if AreAllDown() then
print("All buttons are pressed, open door")
else
print("Not all buttons are pressed, dont open door")
end
end)
end
** You are now Level 2! **
also the MouseButton1Click part might be off, try to replace it with the correct one. I cant remember the name of it off the top of my head
Can you show me where it is sorry im new to this stuff
wdym show you where it is?
like what do to store the script?
do you know what referencing is?
No i do not
ok
a reference is basically the direction to a certain place in memory, think of it as being a houses' address but not the house itself
to get a reference, you use the . symbol between different phrases, I'm sure you've seen that before
it goes like this:
game.Players
or:
game.workspace
or:
workspace.Part
and there are many others
mhm
you can also do:
workspace.Part.Color
to get the part's color