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

How to evaluate the string of a TextLabel?

Im trying to make a script that evaluates a string on a TextLabel when a user presses a button, any help?

Here's my code so far

local operation = script.Parent.Parent.calcarea -- The written formula
local result

script.Parent.MouseButton1Click:Connect(function()
	result = (operation.Text)
	
	print(result)
end)

1 answer

Your code has no issues, inless the object doesn't exist. The issue most likely is because you are using a script, you need to use a localscript as the text property will only be changed on the client, not the server.

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