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

Button being pressed doesnt change the text in a text box?

whats meant to be happening is when you click on a button its meant to change the text in a text box. When ever i press the button i get an error saying "Attempt to index string with 'Text'"

local button = script.Parent
local name = script.Parent.Parent.Parent.Parent.Abilities.Frame.Name
local description = script.Parent.Parent.Parent.Parent.Abilities.Frame.Description
local req = script.Parent.Parent.Parent.Parent.Abilities.Frame.Requirements

function leftClick()
	name.Text = "FireBall"
	description.Text = "Shoot out a small ball of fire from your palm"
	req.Text = "Level - 1"
end

button.MouseButton1Click:Connect(leftClick)

1 answer

✓ Accepted answer
local name = script.Parent.Parent.Parent.Parent.Abilities.Frame.Name

---------------------------------------------------------------------------------------^^^

Change the name of the textbox to something other than 'Name' otherwise you're interfering with the property that already exists called Name.

2 comments

0

still getting the same error

0

Nvm i got it

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