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

How Doesnt This Print The text i want it to?

Asked by 3 years ago
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

Log in to vote
1
Answered by 3 years ago

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

Answer this question