You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
When a value has one of the keys which are true it should do an action/stop
What is the issue? Include screenshots / videos if possible!
It’s only printing one at a time, then printing the next one when the value is changed to the other key
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to re-edit the code multiple times but it’s the same issue, and I also tried looking something similar up
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local mai = {
}
local omg = {
["b"] = true,
["a"] = true,
["c"] = true,
["u"] = false
}
for key, value in pairs(omg) do
if value == true then
table.insert(mai, key)
end
end
for i2,val in pairs(mai) do
repeat wait() print(val)
until game.Players.LocalPlayer.Value == val
end
local mai = { }
local omg = {
["b"] = true,
["a"] = true,
["c"] = true,
["u"] = false
}
for key, value in pairs(omg) do
if value == true then
table.insert(mai, key)
end
end
for i2, val in pairs(mai) do
spawn(function()
repeat
wait()
print(val)
until game.Players.LocalPlayer.Value == val
end)
end
Yeah, this one kind of works, but as I said, it should stop when any of the keys is inserted into the value, not any of them (Thank you for the response anyway )
local mai = { }
local omg = {
["b"] = true,
["a"] = true,
["c"] = true,
["u"] = false
}
for key, value in pairs(omg) do
if value == true then
table.insert(mai, key)
end
end
local Finished = false
for i2, val in pairs(mai) do
spawn(function()
repeat
task.wait()
print(val)
until game.Players.LocalPlayer.Value == val or Finished == true
Finished = true
end)
end