Part's CanCollide is false so players can get inside it. But when players are inside, they have not credited the cash. Please help, thank you! <3
local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if debounce == false then
debounce = true
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 1
wait(1)
debounce = false
end
end
end)

1 comment
Are you sure you have passed the argument for player?