This is pretty simple stuff, but it still isn't working. When I click the button, it puts the error "Players.Player1.PlayerGui.ScreenGui.ShopBG.Sword1.BuyScript:7: attempt to index local 'Player' (a number value)", and then a few lines later "Disconnected event because of exception". Can someone tell me what's wrong?
price = 10
clone = game.Lighting.Sword1
Name = "Wood Sparring Sword"
Player = game.Players.LocalPlayer
function onClick(Player)
if Player.leaderstats.Gold.Value >= price then
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value - price
clone:clone()
clone.Parent = Player.Backpack
clone.Name = Name
elseif Player.leaderstats.Gold.Value < price then
print("Player does not have the required funds for "..Name)
else
end
end
script.Parent.MouseButton1Down:connect(onClick)
