My collectable coin is not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I’m trying to make a coin that you can collect in my game but it’s not seeming to work

  2. What is the issue? when I walk up to it I cant collect it and it’s supposed to put up on the leaderboard that I collected it also it’s supposed to disappear and come back after an amount of time but that’s not working either

  3. **What solutions have you tried so far? i tried following the tutorial again but every thing was correct

Lua
– local coins = Instance.new(“IntValue”,leaderboard)
coins.Name = “Coins”
coins.Value = 25

local recived, failed pcall(function()
	data = dataStore:GetAsync("User-"..player.UserId)
	end)
	
	
if recived then 
	coins.Value = data[1]
	print("Data was recived")
else
	print("Data was recived")
end

while true do wait(30)
	dataStore:SetAsync("User-"..player.UserId,{Coins.Value})
end

end)

game.Players.PlayerRemoving:Connect(function(player)
local leaderboard = player
local coins = leaderboard.Coins

local saved,failed = pcall(function()
	dataStore:SetAsync()("User-"..player.UserId,(coins.Value))
end)

if saved then
     print("Data was saved")
else
     print("Data was not saved")

end

thats my leaderboard script 

-- local coinPart = script.Parent
local toggle = false
local amount = 100000

coinPart.Touched:Connect(function(hit)
	if hit.parent:FindFirstChild("Humaniod") ~= nil and not toggle then 
		toggle = true
		local player = game.Players:GetPlayerFromCharacter(hit.parent)
		local leaderboard = player:FindFirstChild("Leaderboard")
		local coins = leaderboard.Coins
		
		coins.Value = coins.Value+ amount
		
		local coinClone = coinPart:Clone()
		coinPart:Destroy()
		wait(30)
		coinClone.Parent = workspace
		toggle = false
	end
end)
and thats my collect script

In if hit.parent:FindFirstChild("Humaniod") ~= nil and not toggle then you forgot to capitalized Parent make it if hit.Parent:FindFirstChild("Humaniod") ~= nil and not toggle then. Hope this helps!

Also, you made the same error for local player = game.Players:GetPlayerFromCharacter(hit.parent) make that local player = game.Players:GetPlayerFromCharacter(hit.Parent)

game.Players:GetPlayerFromCharacter(hit.parent)
game.Local Players:GetPlayerFromCharacter(hit.parent)
its game. Local Players right?

Nope, just replace all .parents with .Parent as it will only work if capital.

i changed it image
also it says error near line 28
image