I need help (obviously). I made a coin that is spinning (in a serperate script) that is suppose to get touched by a player give the player that touched it +1 in the leaderstat called "Money". I cannot find why it is not working. I check spelling and made sure everything was in the correct order but it is still not working help

coin = script.Parent
player = game.Players.LocalPlayer
hum = player.Character.Humanoid
function money(part)
	local parent = part.Parent
	local human = game.Players:GetPlayerFromCharacter(parent)
	local player = game.Players.LocalPlayer
local debounce = true
	if debounce == true and human and parent.Humanoid.Health > 0 then
		debounce = false
		player.leaderstats.Money.Value = player.leaderstats.Money.Value + 1
		coin.Transperancy = 1
		wait(5)
		coin.Transperancy = 0
		debounce = true
	end
end
coin.Touched:connect(money)
--// In the future, please put your code within a code block. You can do this by pressing the blue button in the editor, and placing your code between the tildes (~).

2 comments

1

"coin.Transperancy = 1", "coin.Transperancy = 0"

1

Also, please use code blocks next time when posting a question. You can insert a code block by clicking the small Lua logo button.