Hello, I am trying to make a script that can find the tool in the ReplicatedStorage. And I wanted to use a StringValue with the value of the tool's name, but I don't know how to do it. Can someone help me, please?
This is the script I use:
local WepName = script.StringValue.Value
local Weapon = game.ReplicatedStorage:FindFirstChild(WepName)
But the problem is, the Value of the StringValue contains spaces. For example, the Value is called "Imperial Gold Sword". It breaks the FindFirstsChild thing and I don't know what to do. Someone help me, please. (Sorry about my bad English, it's not my first language.)

4 comments
FindFirstChild() shouldn't break because of whitespaces in a string. Have you checked to see if the sword is a child of ReplicatedStorage rather than a descendant?
You should name the tool with no space and I think you don't need to use a StringValue for this.
But I wanted to make the data easier to edit cause I got lots of these stuff, and the tool name has to contain spaces or it will look weird in the game.
Spaces should not break the function. The issue should lie under the assumption that the sword is not a child of ReplicatedStorage.