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

How Doesnt This Print The text i want it to?

local text = script.Parent.Text
local btn = script.Parent.Parent.Print

function onclick()
print(text)
end

btn.MouseButton1Click:Connect(onclick)

so it works but only for the text it starts with in roblox studio

1 answer

✓ Accepted answer

this script is not the problem

the problem is that your setting text to a string and that'll never change. but having an object in a variable will have properties that change.

local text = script.Parent
local btn = script.Parent.Parent.Print

function onclick()
print(text.Text)
end

btn.MouseButton1Click:Connect(onclick)

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