i made a script
local function onPlayerJoin(player) local leaderstats = Instance.new("Folder") leaderstats.Name = leaderstats leaderstats.Parent = player local credits = Instance.new ("IntValue") credits.name = "Credit(s)" credits.Value = "50" credits.Parent = leaderstats end game.Players.PlayerAdded:Connect(onPlayerJoin)
and the output says " 16:51:50.409 - ServerScriptService.Script:3: bad argument #3 to 'Name' (string expected, got Object)" its a leadrboardscript
ok so,
use game.Players.PlayerAdded:Connect(function(player)
instead of local function onPlayerJoin(player)
game.Players.PlayerAdded:Connect(function(player) local stats = Instance.new("Folder",player) -- this makes the folder leaderstats and puts it in the player stats.Name = "leaderstats" local credits = Instance.new("IntValue",stats) -- this makes the credits and puts it in the leaderstats credits.Name = "Credits(s)" credits.Value = 50 end)
local function onPlayerJoin(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" --This is in quotes leaderstats.Parent = player local credits = Instance.new ("IntValue") credits.name = "Credit(s)" credits.Value = 50 --numbers are not in quotes credits.Parent = leaderstats end game.Players.PlayerAdded:Connect(onPlayerJoin)