ok so I did
1 | local character = script.parent |
2 | local name = character.Name |
3 |
4 |
5 | name = "anythingiwant" |
There is no errors but the name doesn't change I feel like an idiot
I think your problem is that you didn't capitalize Parent, also you could make your script shorter by doing this:
1 | local character = script.Parent |
2 | character.Name = [ Name Here ] |
or even shorter like this:
1 | script.Parent.Name = [ Name Here ] |
If it's in a script not under the model, you would do do game.workspace.[ModelNameHere].Name = [NewModelName] . However if the model is in a different location such as ReplicatedStorage, Change the workspace to the location.
The problem is that when you change the value of the variable you lose the reference to the object/value you put in the first place.
So instead of saying:
1 | local name = character.Name |
2 |
3 | name = "NameHere" -- Now you can't access the character's name anymore |
do:
1 | character.Name = "NameHere" |
When making variables, only put the object inside it, so you can access the properties without losing reference.
I hope this helps!