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
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)