Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago
Edited 2 years ago

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

0
I'm not sure you can have numbers as names, as all object names default to strings. radiant_Light203 1166 — 2y
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 greatneil80 2647 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

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

0
Or you can use WaitForChild but that uses more space P3droPl4yz_YT 55 — 2y
Ad

Answer this question