NextInterger is not a valid member of Random

Hey everyone! I’m getting the error: “NextInterger is not a valid member of Random - Server - RoundModule:15” , here is my code.

	local rand = Random.new();
	local chapters = game.ReplicatedStorage.Chapters:GetChildren() -- Table of all the map models
	local chosenChapter = chapters[rand:NextInterger(1,#chapters)]
	
	return chosenChapter
end
1 Like

Symtax error

rand:NextInterger
--https://developer.roblox.com/en-us/api-reference/datatype/Random
Random:NextInteger 
1 Like

Wait, what do I change? Im following AlvinBlox’s tutorial and this happened.

Change from this to:

	local chosenChapter = chapters[rand:NextInteger(1,#chapters)]

Syntax error means the spelling is wrong so the compiler reading the script doesn’t know what to do.

Thank you! I am also getting one last error, do you think you can help me?
The error is: Player is not a valid member of DataModel “Diego”

and the code is:

for i,v in pairs(game.Player:GetPlayers()) do
	if not v:FindFirstChild("InMenu") then
		table.insert(contestants, v)
	end
end

Simply change “Player” to “Players”

1 Like

Oh! I ended up misspelling something in there, i fixed it it!