Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to convert a string value to a string in a table?

So for example, how to I put the value C0deCakes.Name to a string in a table so it will show up like this:

example = {"C0deCakes"}

2 answers

✓ Accepted answer
local names = {}
game.Players.PlayerAdded:connect(function(player)
table.insert(names, player.Name)
print(table.concat(names, ''))
end)

I get the Idea of inserting players name into the table, right?

6 comments

0

Will it show up as names = {"C0deCake"}?

0

It puts the player who joins name onto it.

0

Yeah but will it add it like this: names = {"C0deCakes"} or this: name = {C0deCakes}?

0

It prints just C0deCAkes not with ""

0

Would I be able to see if the players name is in the table by using a generic for to iterate through the table then say if player.Name == v?

0

I guess so.

local names = {}
table.insert(names, "C0deCakes")

1 comment

0

What I mean is, how would I insert something like C0deCakes.Name's value into the table in string form? In order for my script to work, we cannot assume the name is C0deCakes, it could be someone other than me.

This discussion is preserved as it was. New answers, comments, and votes are closed.