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

text button not a valid member of the frame??

time2 is in that frame, idk why its saying its not when it is ;/

function Change()

local seconds = script.Parent.Parent.Time

script.Parent.Parent.time2 = seconds.Value    < error happens here 

for i = 1,seconds.Value do
wait(1)
seconds.Value = seconds.Value - 1
script.Parent.Parent.time2 = seconds.Value
end
end
script.Parent.MouseButton1Click:Connect(Change)

2 answers

✓ Accepted answer

Look at line 5;

script.Parent.Parent.time2 = seconds.Value

You didn't set the text of the time2 text button!

Change that line to:

script.Parent.Parent.time2.Text = seconds.Value

Fixed the problem for me. You made the same mistake on line 10, and, off topic, please indent your code properly next time.

1 comment

0

thank you, i feel stupid now lol. ahh but anyways thanks!

i dont know if thats correct, but try doing this:

function Change()

local seconds = script.Parent.Parent.Time

script.Parent.Parent:WaitForChild("time2") = seconds.Value

for i = 1,seconds.Value do
wait(1)
seconds.Value = seconds.Value - 1
script.Parent.Parent.time2 = seconds.Value
end
end
script.Parent.MouseButton1Click:Connect(Change)

if not, then this:

function Change()

local seconds = script.Parent.Parent.Time

script.Parent.Parent:FindFirstChild("time2") = seconds.Value

for i = 1,seconds.Value do
wait(1)
seconds.Value = seconds.Value - 1
script.Parent.Parent.time2 = seconds.Value
end
end
script.Parent.MouseButton1Click:Connect(Change)

if it stilll doesnt work, please send me a screenshot of your startergui.

1 comment

0

= sign giving me the red line.

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