I am having an error with my Give Cash button. Inside the player there is a folder with a lot of BoolValues to check if the player already has received cash from that specific button.
Attempt to index nil with ‘CashButtons’ on line 3.
script.Parent.Touched:Connect(function(hit)
local PlayerInPlayers = game.Players:GetPlayerFromCharacter(hit.Parent)
if PlayerInPlayers.CashButtons.B5.Value == false then
PlayerInPlayers.leaderstats["Cash"].Value = PlayerInPlayers.leaderstats["Cash"].Value + 10
PlayerInPlayers.CashButtons.B5.Value = true
end
end)