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

Problem with this function?

Asked by 9 years ago
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.

0
Try and use a server script. Redbullusa 1580 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago

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.

Ad
Log in to vote
0
Answered by 9 years ago

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

0
Please use the comments for this kind of thing. Please do not write an answer if it's not an answer. AmericanStripes 610 — 9y
0
It is and answer XD robloxiveboy 25 — 8y

Answer this question