**I have tried to find what the error is but im new to studio and dont understand can someone please help me! **
script.Parent.Touched:Connect(function(hit) if hit then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player.leaderstats.Coin.Value >= script.Parent.Requirement.Value then player.leaderstats.Coin.Value -= script.Parent.Requirement.Value for i,v in pairs(workspace.Maps.DesertMap:GetChildren()) do v.Transparency = 1 v.CanCollide = false end end end end)
I think the issue is you have to create a leaderstats folder before trying to call it. It does not automatically get inserted into the player, so you have to make it yourself. Try searching for how to make a leaderboard if you don't know how.