How to find a folder with the same name as a string value?
Asked by
4 years ago Edited 4 years ago
I'm trying to make a character swap system, something similar to genshin impact but I'm having quite bit of trouble getting a small part through.
So there is a local script that changes a stringvalue's value to a different name and then if it has been changed it fires a remoteevent on server side which has to change the player's appearance and everything works until this lines of code:
1 | for i,v in pairs (rs:GetChildren()) do |
2 | if v.Name = = cf.Current.Value then |
you can ignore the print(v.Name) part because its just a way to debug.
The issue there is that it doesn't find any folders with the same name as the value in the stringvalue.
1 | for i,v in pairs (rs:GetChildren()) do |
2 | if v.Name ~ = cf.Current.Value then |
^ This version of the code makes it so everything in "rs" get printed even if it has the same name as the value in the stringvalue so i think the issue is in the value itself but i cannot find why