77jaiz
(jaiz)
March 20, 2022, 11:02pm
#1
What I am trying to achieve here is, changing a table value, well, why?
I’m making code that reads from a table, and I’m making a gamepass that modifies those values. This is basically like a FNaF Fast Nights gamepass.
local waitTimes = {
[12] = 30,
[1] = 30,
[2] = 30,
[3] = 30,
[4] = 30,
[5] = 40,
[6] = 50,
}
How/What is the way to change the table value “12” that equals 30 to 20?
e.g: waitTimes[12] = 30 (Didn’t work)
waitTimes[12] = 20 should definitely work unless you’re setting the table back to the other value elsewhere
2 Likes
SKURMIEE
(MIRA)
March 20, 2022, 11:09pm
#3
You’re trying to change the twelfth value in a table. waitTimes[12] does not exist, [12] = 30 does.
tlr22
(FusionOak)
March 20, 2022, 11:10pm
#4
Did you mean to write
waitTimes[12] = 20
Because currently you are setting the value to what it already is.