Attempt to index a nil value?
When i buy a certain item with this script from a simulator-like shop, it gives me the error Attempt to index a nil value.
1 | game.ReplicatedStorage.ShopBuy.OnServerEvent:Connect( function (player,page) |
2 | local tool = game.ReplicatedStorage:WaitForChild( "Tools" ) |
3 | local shop = game.Workspace.Shop |
4 | local clone = tool:FindFirstChild(shop:FindFirstChild( "Part" ..page).ItemName.Value):Clone() |
5 | local clone 2 = tool:FindFirstChild(shop:FindFirstChild( "Part" ..page).ItemName.Value):Clone() |
6 | clone.Parent = player.Backpack |
7 | clone 2. Parent = player.StarterGear |