This is the cash script
local part = script.Parent
local cash = part.Parent.Money
part.Transparency = 1
part.Position = cash.Position
part.Touched:Connect(function(hit)
local player = hit.Parent
if player:FindFirstChild("Humanoid").Health > 0 then
if player.Name == game.Players.THIS_IS_THE_PROBLEM.Name then
game.Players.THIS_IS_THE_PROBLEM.leaderstats.Cash.Value = game.Players.THIS_IS_THE_PROBLEM.leaderstats.Cash.Value +3
end
end
end)
I could just put my name there, but i need to somehow get the name of the player that touched hitbox from game.Players tab.

2 comments
Take a look at :GetPlayerFromCharacter https://developer.roblox.com/en-us/api-reference/function/Players/GetPlayerFromCharacter
Thx, that exactly what i was looking for