Hi there.

I am trying to make a surfacegui thingy that lets you change text on a tool you are holding with a gui, and this is the code I have:

player = script.Parent.Parent.Parent.Parent.Parent.Character

script.Parent.FocusLost:connect(function(enterPressed)
	player.Protest.Handle.SurfaceGui.Frame.TextBox.Text = script.Parent.Text
end)

It works in studio just fine, and does its purpose, but this error is emitted: 20:23:30.183 - Character is not a valid member of Backpack 20:23:30.184 - Script 'Players.Player.Backpack.Protest.ProtestGui.ProtestUI.TextHe', Line 1 20:23:30.184 - Stack End

Upon going into a real game with it, no code changed, I get this error and it refuses to work: http://prntscr.com/7tldbr

Could use some help on this.

3 comments

0

Where is this script located?

0

Posting 4 million parents to the character is a horrible idea. use game.Players.LocalPlayer

0

Any chance of a hierarchy chart/diagram?