Hello, Im trying to make a ShopGui, when click the server will be fire and the ClassicSword value will become true ( mean player will be own the sword ) but the issue is, is saying me the error
16:41:41.262 - ServerScriptService.onClickPurchase:3: attempt to index nil with 'Value'
There is all of my script :
On Click Purchase Script ( SSS )
game.ReplicatedStorage.onClickBuy.OnServerEvent:Connect(function(plr)
if plr.leaderstats.Gold.Value >= game.StarterGui.ShopGui.Frame.MainFrame.WeaponStats.Price.Value then
if plr.WeaponStorage.OwnsWeapon:FindFirstChild(game.StarterGui.ShopGui.Frame.MainFrame.WeaponStats.WeaponValue.Value).Value == false then
plr.WeaponStorage.OwnsWeapon:FindFirstChild(game.StarterGui.ShopGui.Frame.MainFrame.WeaponStats.WeaponValue.Value).Value = true
else
print("Purchase Failed!")
end
end
end)
Fire Server Script ( Buy Button )
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.onClickBuy:FireServer()
end)
Can anyone help me?

3 comments
Maybe its that?
It happend on line 3 so it cant be that
Yes sorry I made a mistake