How to find number of items in a text list?

So lets say that I have a text property that would look like this in gameplay:

ToST, ToGG, CoDA

I need to find the number of commas in this property to count how many items are in this list. How do I do this?

Will every item be 4 letters long?

No.

Uhm, I don’t think this is possible. But i’m bad at properties so idk…

No way you’re making JToH!!!

I think you should use the text substring blocks
(ps: i beat ToC like a few months ago yaya)

3 Likes

Yo what Juke’s TOH?

Roblox game. Crazy hard platformer. Play it. It’s pretty fun, has a kinda toxic and elitist community, it’s kind of a huge waste of time and will make you annoyed and empty feeling, but you can try it. The start is still really fun and it’s an underrated Roblox game. So basically, as with most games, the community is questionable but the game itself is fine. Also, the start of the game and the early game SUCKS. I am sorry, but most towers in Rings 1 - 6 and in Zones 1 - 3 are unforgettable, spammy, uncreative, have unindicated traps, and are basically all the same. You just have to look for the (not so) hidden gems like CoLS, ToDC, ToDD, ToMH, ToHS, CoHaD, to name a few.

2 Likes

I, like live on rblx…

Diehard fan since 2015, anyways back on track.

So, all of roblox?

4 Likes

This is my code so far, what does letter # from end mean, my brain is smooth.
Screenshot 2024-08-21 9.43.30 PM

How many letters from the end it is
So in the text “text”
letter #3 from end is “e”
Just count backwards from the end.

1 Like

i tried making a tower game in gimkit but i quickly ran into a few issues - the barrier limit, the fact that it’s hard to make good 2D gameplay without adding external mechanics or COs or interfering with the raw gameplay - the terrain limit, and difficulty balancing. if you’ve solved those, can i have a few tips on how to work around those constraints?

the property myList = "among, us, sus, lol"
the property lastIndex = 0
the property itemCount = 0

When receving on countList:

//get the list, and the position of the last comma we found
text = getProperty("myList")
lastIndex = getProperty("lastIndex")

//find the newest comma
text = getSubstring(text, lastIndex + 1, [last letter])

//check if there is a comma after the last one
index = findFirstOccuranceOfStringInText(text, ",")
if (index != 0):
    //count the comma and set the lastComma index to this new comma
    setProperty("lastIndex", index)
    setProperty("itemCount", getProperty("itemCount") + 1)
    broadcastOnChannel("countList")
else:
    addActivityFeed(convertNumberToText(getProperty("itemCount")))

This should work although I didn’t actually test it so idk for sure

7 Likes

You could add a counter at the end of every tower that would increment by one, and some other code to identify what towers have been beaten, instead of having them all be listed in one row.

WAIT, you can text code in Gimkit!

Oh crap I overcomplicated this, optionally you could just loop over the text and count the commas but this solution takes less iterations :sunglasses:

2 Likes

No, that’s just me being too lazy to actually write the code in gimkit. I just wrote down the names of the blocks.

:sob:

I was gonna make something that did that but your big brain coded too fast

Okay wait I have to do IRL stuff like sleeping, it’s about 10:00 PM where I am (:skull:), so bye everyone for now I guess.

1 Like