I don't understand why but he sends me an error message " 16:48:55.855 - Workspace.Tycoon.Starter.Collector.Touch.Script:6: attempt to index nil with 'leaderstats' 16:48:55.855 - Stack Begin 16:48:55.856 - Script 'Workspace.Tycoon.Starter.Collector.Touch.Script', Line 6 16:48:55.856 - Stack End" and I think he can't find the localizer because when I put my roblox name it works here are my scripts for my leaderboard:
function onPlayerEntered(newPlayer)
local leaderstats = Instance.new("IntValue")
leaderstats.Name = ("leaderstats")
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Value = 1000
cash.Parent = leaderstats
leaderstats.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)
for my script:
player = game.Players.LocalPlayer
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")
then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + script.Parent.Parent.screen.Amount.Value
script.Parent.Parent.screen.Amount.Value = 0
end
end)

2 comments
Thanks a lot without you I'd still be stuck
No problem :D It would be nice if you could accept my answer :D