Hi, So I am trying to make a fighting simulator, and for some reason, it underlines this word = 1stPlayer , you can see it and here is my script:
function sayhello() print("hi there") end -- complexed function to shut down server function EndServer() --get list of all players **1stPlayer** = game.Players:GetChildren --loop through our list of players and kick each of them out. for _ , i in pairs(1stPlayers) do i:kick("The server is shutting down") end end sayhello() wait(5) EndServer()
The reason it's underlined in red is because you put a number before letters. Here's how it should look
function sayhello() print("hi there") end -- complexed function to shut down server function EndServer() --get list of all players Player1st = game.Players:GetChildren --loop through our list of players and kick each of them out. for _ , i in pairs(1stPlayers) do i:kick("The server is shutting down") end end sayhello() wait(5) EndServer()
Pretty sure it'll work