I'm looking to see if a tool is in ServerStorage that a player has entered in their textbox.
Here is an example of what I attemped:
local SecondaryName = v.Weapons.Secondary.Text
if not game.ServerStorage.Weapons.Secondary[SecondaryName] then
else
local Secondary = game.ServerStorage.Weapons.Secondary[SecondaryName]:Clone()
Secondary.Parent = v.Backpack
The game stops after the "if not" when the object doesn't exist. This is what I'm trying to prevent by using the statement. What else could I try?
I know you can use this to see if parts or objects exist and I can partially see why this wouldn't work but not sure what else to use.
Extra: The text is sent to this Server Script from a remote function so this is all server-side

1 comment
sorry, i suppose i could have explained this in my answer to your last question