Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Player is not valid member of model?

function LeaderBoard(Fisherman) local leaderstats = Instance.new("Model") leaderstats.Name = "leaderstats" leaderstats.Parent = Fisherman

local money = Instance.new("IntValue") money.Name = "Name" money.Parent = leaderstats money.Value = 10

end

game.Players.PlayerAdded:connect(LeaderBoard()

I have copied this code from one video but when i press start it says player is not valid member of model. What i should do or what i have done wrong?

1 answer

The only problem I see with your code is when you tried to connect the PlayerAdded event. You have an open bracket that was left by itself inside the event Connection. I fixed that, however, I am not in ROBLOX studio right now so I cannot test this.

function LeaderBoard(Player) 
	local leaderstats = Instance.new("Model") 
	leaderstats.Name = "leaderstats" 
	leaderstats.Parent = Player
	local money = Instance.new("IntValue")
	money.Name = "Name" 
	money.Value = 10
	money.Parent = leaderstats 
end

game.Players.PlayerAdded:connect(LeaderBoard)

This discussion is preserved as it was. New answers, comments, and votes are closed.