Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

text button not a valid member of the frame??

Asked by 5 years ago

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

Log in to vote
1
Answered by 5 years ago

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.

0
thank you, i feel stupid now lol. ahh but anyways thanks! A1exTatum 57 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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.

0
= sign giving me the red line. A1exTatum 57 — 5y

Answer this question