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

Gui Script help- why does the output say this?

So, this script is supposed to check the text of two textlabels, and if they are 'easy' and 'action & adventure' Make one of two GUIs pop up. When I run it, the output says this

20:55:21.055 - Players.Player.PlayerGui.ScreenGui.results.LocalScript:13: bad argument #2 to '?' (string expected, got boolean)

results.LocalScript is the script I mentioned above. Here is the script...

-- Here is the LocalScript!
wait(1)
player = game.Players.LocalPlayer
gui = player.PlayerGui.ScreenGui
results = gui.results
stepone = results.step1choice
steptwo = results.step2choice
RVisible = results.Visible
TMM = results.TMM.Visible
LD = results.TMM.Visible

results.Changed:connect(function()
	local value = results[RVisible]
	wait(1)
	results.Loading.Visible = true
	if stepone.Text== "Action & Adventure" then
		if steptwo.Text== "Easy" then
			local num = math.random(1,2)
			if num== 1 then 
				TMM = true
				
			else
				LD = true
				
			end
		else
			script:Destroy()
		end
	else
		script:Destroy()
	end
end)

Thanks for the help!

1 comment

0

Line 13 should be local value = results.Visible

1 answer

✓ Accepted answer

Well, you misused your variables. Change line 13 to

local value = RVisible

4 comments

0

Thank you! I got that script from an alternate source, I didn't think it looked right...

0

Hah, been there some that. No problem.

0

Hey, the script still doesn't work, can you see any other problems with it? I made sure that my two 'if' statements are true, I can't figure out why it doesn't work. Thanks!

0

Not that I see. What does the output error?

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