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

players is not a valid member of DataModel "Sword game roblox 2.rbxl" Hvat is hapening?

6 players is not a valid member of DataModel "Sword game roblox 2.rbxl"  -  Server  -  Main script:19   21:04:41.096 Stack Begin  -  Studio   21:04:41.096 Script 'ServerScriptService.Main script', Line 19  -  Studio  -  Main script:19   21:04:41.097 Stack End  -  Studio

-- Dfine veriables

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

local MapsFolder =ServerStorage:WaitForChild("Maps")

local Status = ReplicatedStorage:WaitForChild("Status")

local GameLength = 50

-- Game loop

while true do

Status.Value = "Waiting for enough players"

repeat wait(1) until game.players.NumPlayers >= 2

Status.Value = "Intermission"

wait(10)

local plrs = {}

for i, player in pairs (game.Players:GetPlayers()) do
	if player then
		table.insert(plrs,player) -- Add each player into plrs table
		
	end
end

I am folowing this vidio https://www.youtube.com/watch?v=1MappXJ51Oo. and this https://www.youtube.com/watch?v=vCpl5M_9mcQ Pleas help me?

1 answer

Look at

repeat wait(1) until game.players.NumPlayers >= 2

Capitalize the "p" in "players" It's game.Players, not game.players. Coding is case-sensitive just like me ;( anyways, you should work on formatting your posts.

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