Hey, so I'm making an application center for my group I'm making, but in my script a StringValue is supposed to change so that the server can recognize if the player got the correct answer or not, but my StringValue just isn't changing. My script:
(Client Button)
script.Parent.MouseButton1Click:Connect(function() local current = script.Parent.Parent.Selected.Value if current == "None" then script.Parent.Text = "X" script.Parent.Parent.Selected.Value = "D" elseif current ~= "D" then local switch = current.."B" script.Parent.Parent:FindFirstChild(switch).Text = "" script.Parent.Text = "X" script.Parent.Parent.Selected.Value = "D" end end)
(Server)
script.Parent.Parent.Parent.Submit.END.MouseButton1Click:Connect(function() local q = script.Parent.Parent.Parent.Q1.Selected.Value local a = script.Parent.Parent.Parent.Q1.Right.Value if a == q then script.Parent.Text = " ?" script.Parent.Parent.Right.Value = script.Parent.Parent.Right.Value + 1 else script.Parent.Text = "X" end end)
Thanks in advance.
I would change the way that you are checking to see if a question was right.
Local script that is inside the button, here is some pseudocode
script.Parent.MouseButton1Click:Connect(function() local current = script.Parent.Parent.Selected.Value if theCurrentIsAtLeastValid then local res = -- use a remote function to see if the answer is correct if the server told us it was the correct answer then -- tell the user they got is correct else -- tell the user they got it incorrect end else -- tell the user their input is not valid end end)
Server script in ServerScriptService
function remoteFunction.OnServerInvoke(player, question, answer) if the answer is the correct response to the question then return true else return false end end