Works in Roblox Studio, not Roblox

Hi, recently I have came up with an idea to build a larger scale roleplay group. Today, I made a Citizenship Game where it you get a certain amount of questions correct via multiple choice, it’ll promote you with a rank.

In ROBLOX studio, the script runs fine and connects to the server. Connecting to the server isn’t the issue. When I published it in the ROBLOX game, it broke after question 2. I don’t know how to make it work on ROBLOX when HTTP is enabled and API services. I’ve tried to use print("") but it hasn’t worked out.

Here’s what is here:

In-Game Developer Console: https://gyazo.com/65ded7aedd62d34b4a0a34b063ce7341
In-Game Point Where it causes it to break: https://gyazo.com/498f9c7c399169a83801b29aa3f9578f

Studio working fine: https://gyazo.com/587c744f3f9ff4b46f045e4daa71b227

Don’t know what’s going on when players answer each question but it seems like it’s skipping the third question even on the studio working fine gif so maybe you’re checking for the exact number (which can bug because ROBLOX rounds things so you might try using integers or math.floor) or maybe your question doesn’t exist but you already have a script checking if it’s existing or something so that’s why it’s not erroring?

You more then likely probably just missed something.

Not sure if this helps to explain a bit more. It was working on a previous game of mine, but not sure what happened.

	for i,v in pairs(script.Parent:GetChildren()) do
		if v.Name == "wrong" or v.Name == "correct" then
			if v.BackgroundTransparency == 0 then
				if v.Name == "correct" then
					game.Players.LocalPlayer.Correct.Value = game.Players.LocalPlayer.Correct.Value + 1;
					break;
				end
			end
		end
	end
	
	script.Parent.Parent.Q3.Enabled = true;
	script.Parent.Enabled = false;
end)```

You have ‘break’ ran if the person selects the correct answer. And since that’s called, I’m pretty sure

script.Parent.Parent.Q3.Enabled = true;
script.Parent.Enabled = false;

Can’t be runned.

Edit: Big poop mode, nvm. I was wrong. Is the local script I’m looking at in Q3?

The script is in every question except the last one which rounds the total and kicks the person from the game and depending on their results, ranks them. The part of changed is script.Parent.Parent.Q#.Enabled = true;

Yes, I’m pretty sure you’re enabling and disabling the same GUI then. Check Q3 to Q4.

Question 3:

	for i,v in pairs(script.Parent:GetChildren()) do
		if v.Name == "wrong" or v.Name == "correct" then
			if v.BackgroundTransparency == 0 then
				if v.Name == "correct" then
					game.Players.LocalPlayer.Correct.Value = game.Players.LocalPlayer.Correct.Value + 1;
					break;
				end
			end
		end
	end
	
	script.Parent.Parent.Q4.Enabled = true;
	
	
	script.Parent.Enabled = false;
end)```




**Question 4:**
```script.Parent.TextButton.MouseButton1Down:Connect(function()
	for i,v in pairs(script.Parent:GetChildren()) do
		if v.Name == "wrong" or v.Name == "correct" then
			if v.BackgroundTransparency == 0 then
				if v.Name == "correct" then
					game.Players.LocalPlayer.Correct.Value = game.Players.LocalPlayer.Correct.Value + 1;
					break;
				end
			end
		end
	end
	
	script.Parent.Parent.Q5.Enabled = true;
	
	
	script.Parent.Enabled = false;
end)```

Also, question 2 and 3 are the same because I just copied and pasted the GUI and changed the script

Ah I’m sorry, I mean in question 2’s script the Q should be Q3 or is it not Q3 already?

In Q2,

	for i,v in pairs(script.Parent:GetChildren()) do
		if v.Name == "wrong" or v.Name == "correct" then
			if v.BackgroundTransparency == 0 then
				if v.Name == "correct" then
					game.Players.LocalPlayer.Correct.Value = game.Players.LocalPlayer.Correct.Value + 1;
					break;
				end
			end
		end
	end
	
	script.Parent.Parent.Q3.Enabled = true;
	script.Parent.Enabled = false;
end)```

It works perfectly fine in studio and sends the request to the server for the rank, but in ROBLOX it crashes after I submit S2

Ok then perhaps use :WaitForChild()

After script.Parent.Parent.Q3.Enabled = true;?

Perferably I would just make Q3 as a variable with WaitForChild() and use it that way.

local Q3 = script.Parent.Parent:WaitForChild("Q3")
script.Parent.TextButton.MouseButton1Down:Connect(function()
	for i,v in pairs(script.Parent:GetChildren()) do
		if v.Name == "wrong" or v.Name == "correct" then
			if v.BackgroundTransparency == 0 then
				if v.Name == "correct" then
					game.Players.LocalPlayer.Correct.Value = game.Players.LocalPlayer.Correct.Value + 1;
					break;
				end
			end
		end
	end
	
	Q3.Enabled = true;
	script.Parent.Enabled = false;
end)

You can also replace your Q3 line with script.Parent.Parent:WaitForChild(“Q3”).Enabled = true;

1 Like

Let me try both things and test them out.

None of them worked, I am questionate because on a previously center that has a replica of the script except the server works perfectly.

Original Game: Luli Job Center - Roblox

Game Now: Resident Portal - Roblox

(apologies in advance if you have to join a group, let me try to disable that)

Are the buttons, labels, and images inside Q3 not archivable or not visible?

They seem to be all archivable and visible. It’s just the ScreenGUI is disabled for well, you know that

Question 3 is there by the way

Another main question, why would studio be working but not ROBLOX?

ROBLOX Studio sends the request to the server, goes through the GUIs correctly, etc.