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

How to Get a part that has an int name ( like 1) ?

Hello I am doing a script but I must recover the name on the part but when I do:


game.Workspace.Checkpoints.0

He tells me that there is a problem How to recover the part without modifying the name itself

2 comments

0

I'm not sure you can have numbers as names, as all object names default to strings.

0

fool! he named an object an int. He's trying to index it but it appears as a number. It is possible to name objects numbers but you would have to use FindFirstChild, WaitForChild or ["0"] in this case. A loop works as well

1 answer

Roblox has brackets and double quotes. Names that violate the name requirements like numbers, symbols, keywords, can be used by doing this (example)

workspace["0"].child

thats how it works, you dont use the first dot, but the second dot still must be there for the child if oyur trying to get one, and you just use [""].

hope this helps :3

1 comment

0

Or you can use WaitForChild but that uses more space

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