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

I was following a tutorial by AlvinBlox and it says I did something wrong. Help?

I was trying to make a simple Roblox game with a tutorial from AlvinBlox and it keeps saying the following message: "ServerScriptService.MainScript:27: Expected identifier when parsing expression, got ')'" And when I try to fix it: "ServerScriptService.MainScript:82: Expected 'end' (to close 'do' at line 27), got "

I followed everything he said to do in the tutorial (https://www.youtube.com/watch?v=1MappXJ51Oo) so I can't figure out what I did wrong! If any of you can help me fix my game and not have to restart, I would greatly appreciate that.

P.S-I have already tried to rewrite the line, it won't work. EDIT: My main script is here (down to my issue, line 27):


local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

local MapsFolder = ServerStorage:WaitForChild("Maps")

local Status = ReplicatedStorage:WaitForChild("Status")

local GameLength = 300



while true do
	
	Status.Value = "Waiting for enough players"
	
	repeat wait() until game.Players.NumPlayers >=2
	
	Status.Value = "Intermission"
	
	wait(15)
	
	local plrs = {}
	
	for i, player in pairs (game.Players:GetPlayers()) do
			if player then
				table.insert(plrs,player)

10 comments

0

Can we get your version of the script?

0

I put my script down to line 27, where it located an issue.

0

Post your full script, or a longer one with more context.

0

Fix your formatting

0

Why is there asterisks?

0

This looks like you did not post your whole script. I would hope at least this is not your whole script.

0

Do not post code that does not belong to you, and only you. It is generally discouraged to do so on this website.

0

This has now been answered, but I would severely question either: the validity of a tutorial in which this kind of mistake isn't obvious to you by the end, as it very much should be; or why you're rushing through to get to a completed script, since you may as well just be using free models or something at that point.

0

Guys, I'm really confused. What the heck is an "end loop"?

0

it might just be an old video/script, and it got outdated from all of the roblox updates.

1 answer

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

local MapsFolder = ServerStorage:WaitForChild("Maps")

local Status = ReplicatedStorage:WaitForChild("Status")

local GameLength = 300

while true do
	Status.Value = "Waiting for enough players"

	repeat wait() until game.Players.NumPlayers >=2

	Status.Value = "Intermission"

	wait(15)

	local plrs = {}

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

I did the same exact tutorial. My game worked. You forgot to add end marks at the end of the for loop. End marks are very important for loops like for and while do. Hope this works!

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