whenever i seem to test it the script goes away and i cant run the script script type is just script the script is
Numplayers = 1 Minigames = game.ServerStorage.Minigames : getChildren ()
function msg (text) print (text) end
01 | function PlayerAdded(Player) |
02 | local Bool = Instance.new ( "BoolValue" , Player) |
03 | Bool.Name = "AFK" |
04 | end |
05 |
06 | function GetPlayers() |
07 | local Players = { } |
08 | for i,v in pairs (game.Players:GetChildren()) do |
09 | if v:FindFirstChild ( "AFK" ) and not v .AFK.Value then |
10 | table.insert(Players, v) |
11 | end |
12 | end |
13 | return players |
14 | end |
15 | game.Players.PlayerAdded:connect(PlayerAdded) |
When you go into Play Mode in studio, by default you see the client, which doesn't have access to ServerStorage nor ServerScriptService. There's a button to switch between server and client; while looking at the Explorer window while seeing things from the server's perspective you'll be able to see them.
Note that scripts will not run in ServerStorage.
You have a function named msg
that just calls print
, but you refer to it as Msg
-- Lua is case-sensitive, so this will error. If you have the output window open when you run the place you should be able to see any errors or other problems that Roblox encounters with your script.