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:
for i,v in pairs(rs:GetChildren()) do
if v.Name == cf.Current.Value then
print(v.Name)
end
end
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.
for i,v in pairs(rs:GetChildren()) do
if v.Name ~= cf.Current.Value then
print(v.Name)
end
end
^ 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

3 comments
Is the name of
vthe same ascf.Current.Value? Maybe one of the names has a capital letter and the other doesn't. Maybe, since you said you're handling the changing of the value on the client, filtering enabled is getting in the way. We can't tell without more code/contextThe problem is that you're changing the value on the client and comparing that same value on the server.
@R_alatch this was actually the issue thanks if you put it as an answer i can accept it as an asnwer