Obtaining Humanoid based on StringValue within Model

Hi,

I’m trying to change the walking speed of a humanoid within a custom character model via an in-game event, but I’m not too sure how to do so. This is because of my character skin system, by which characters are given unique names, and thus, can’t be referred to, generally.

I have a StringValue - MALWARE - attached to each character, thus giving them a single commonality, but I don’t know how to refer to the character that possesses this value.

Any advice is appreciated.

make a name tag with their commonality, I think

you should make the nametag text be the stringvalue’s value

Try looping the characters and checking if it has the value of the same name as the one you are looking for

Use a :GetDescendants() function to loop trough the characters

for i,v in pairs (game.Workspace:GetDescendants()) do
if v:IsA(„StringValue“) and v.Parent:IsA(„Model“) then
v.Parent.Humanoid.WalkSpeed = 10
end
end

Maybe sth like this?

Heyo, here are possible solutions:

  1. I would recommend this, Players:GetPlayerFromCharacter , but that might not work for this situation.

  2. If only players have the “MALWARE” StringValue, then you can check the children of things to find out if it’s a player or not. Instance:GetChildren

  3. You can make it so the players character gets put into a folder inside workspace when they join. This idea is more so for organization than anything, but here is how you know when a player joins: Players.PlayerAdded