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

Random scripting glitches?

Asked by
shayner32 478 Trusted Moderation Voter
9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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.

0
Where is this script located? minikitkat 687 — 9y
0
Posting 4 million parents to the character is a horrible idea. use game.Players.LocalPlayer unmiss 337 — 9y
0
Any chance of a hierarchy chart/diagram? TheArmoredReaper 173 — 9y

Answer this question