Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix this script?

Asked by 10 years ago
function PlayerAdded(player)
local leaderstats = Instance.new("Model", player)
leaderstats.Name = "leaderstats"

local money = Instance.new("IntValue", leaderstats)
money.Name = "Money"
money.Value = 100000
end

game.Players.PlayerAdded:connect(PlayerAdded)

Everytime I run this script I get two errors. 1)17:29:02.579 - Plugin_142731176._Char:15: attempt to index local 'myPlayer' (a nil value) 2)17:29:02.736 - Attempt to connect failed: Passed value is not a function

Any help?

Answer this question