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

Problem with this function?

function Hello ()
	print (game.Players.NumPlayers)
end

game.Players.PlayerAdded:connect(Hello)

So I just started a few days ago learning to program and this is my first script so far and I don't know whats wrong with this!?!

P.s I am using a local script if that means anything.

2 comments

0

Try and use a server script.

2 answers

Local Scripts are client-specific, meaning they need to be a descendant of a player to run. Server Scripts run on the server, meaning they can run anywhere. Just put your code in a Server Script (Default Script) and it should work just fine.

Try using this script on a server script and should help work if not reply back.

2 comments

0

Please use the comments for this kind of thing. Please do not write an answer if it's not an answer.

0

It is and answer XD

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