How do I fix this error?

So I keep getting this error

  12:21:14.052 - Result is not a valid member of Frame "Players.Oozymage.PlayerGui.AmongUsTask.Background"

Script is here:

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.Type.Text == "69372" then
		script.Parent.Parent.Result = "Task Completed!"
		wait(2)
		script.Parent.Parent:TweenPosition(UDim2.new(1,0,0,0))
	else
		script.Parent.Parent.Result.Text = "Task Failed!"
		wait(1)
		script.Parent.Parent:TweenPosition(UDim2.new(1,0,0,0))
	end
end)

(My friend told me to test his game and he got this error and he cant fix it now because he is sleep) please someone help

try changing this line to

script.Parent.Parent.Result.Text = "Task Completed!"

I guess you could add a wait for child on the

script.Parent.Parent.Result.Text

it would become

script.Parent.Parent:WaitForChild("Result").Text

also the first one you should probally add a .Text to it as Kingerman88 said

ok i will

and ok @56ytr56 I’ll be back to say thank you if it worked to the both of you

thank you and thank you too @56ytr56 :smiley: