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

why is Textbox.Text nil when it has text?

Asked by 5 years ago
Edited 5 years ago

script.Parent.Parent.Parent.Parent = Playergui script.Parent.Parent.Parent = Frame Script.Parent.Parent = textbox script.Parent = Textbutton

when i click the textbutton it prints:

(a blank print)

nil

Players.flireferret.PlayerGui.ScreenGui.Frame.Textbox.TextButton.Script:6: attempt to index a nil value Stack Begin Script 'Players.flireferret.PlayerGui.Frame.Textbox.TextButton.Script', Line 6 Stack End

local player = script.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
    print ((script.Parent.Parent.Text))
    print ( tonumber(script.Parent.Parent.Text))
    player:FindFirstChild("soundid").Value =  tonumber(script.Parent.Parent.Text)
end)
0
Are you running this from a server script? the changes the player makes in a gui isn't server sided. antoniorigo4 117 — 5y
0
it's a server script flireferret 26 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

I may be wrong, but in your print on line 4 maybe try and remove the extra parentheses

1
that doesen't affect anything flireferret 26 — 5y
Ad

Answer this question