Hello, I am trying to give myself a sword called "Hot" using a LocalScript in StarterGui. The so called weapon is inside ServerStorage. This is the code:
local hotsword = game.ServerStorage:FindFirstChild("Hot")
local clonedHotSword = hotsword:Clone()
clonedHotSword.Parent = player.Backpack
Whenever I test the game, I get the following error:
Players.Xrp200.PlayerGui.LocalScript:190: attempt to index local 'hotsword' (a nil value)
^I have no idea what the error means^
I have tried this with WaitForChild() but then it would give me a warning:
Infinite yield possible on 'ServerStorage:WaitForChild("Hot")'
And ends up never giving me the sword.
I'm a beginner at scripting and I can't seem to fix this issue properly, please help.. thanks.

8 comments
Put the Model inside of the "ReplicatedStorage" and get it from there.
it has nothing to do with that he just diddnt make a variable for player
and u might wanna use a if statement
I have tried putting it in ReplicatedStorage, I got the weapon but the sword falls apart whenever I equip it. I have made the variable for player, it's just that I didn't put everything so that it's easier to read guess?
Or is that actually a whole different error/my fault?
Taco, When i'm in roblox studio and i put stuff inside of the serverstorage and then if i test play it removes from the ServerStorage.
Same! Everything inside ServerStorage dissepears!
Yea, That's why it says "Nil", Because it won't find the model in the ServerStorage.