Im trying to get a value of a StringValue but keeps saying in the output " 22:47:37.989 - Players.dizzyjamison08.PlayerGui.Shop.Stats.TextButton.LocalScript:6: attempt to index a nil value" im using filtering enabled and the values not nil, i checked. heres the script
axe = script.Parent.Parent.Axe.Value
script.Parent.MouseButton1Click:Connect(function(player)
if game.Players.LocalPlayer.leaderstats.Bux.Value >= script.Parent.Parent.Pricie.Value then
print("Not Poor")
local equip = game.Lighting:FindFirstChild(axe):Clone()
equip.Parent = game.Players.LocalPlayer.Backpack
end
end)

1 comment
Please do not use Lighting for storage. That is not what the service is for. You also do realise that MouseButton1Click does not give you the player who clicked the button, right? It wouldn't make sense for it to either, and exploiters can easily abuse the fact that you are doing this all from a localscript