Currently I'm trying to edit the text inside of the Player's PlayerGui, and the only error that APPEARS to be connected to this script is "TextBounds is not a member" or something like that. The thing is nothing in my script messes with TextBounds. The hierarchical structure of my variables are correct. Here's my script:
wait(1) A = script.Parent.Parent.Parent.PlayerGui.ChooseFoot.CFF.CF function ChangeFeet(CF) if CF == Enum.KeyCode.LeftAlt then if A.Text == ("R") then A.Text = ("L") elseif A.Text == ("L") then A.Text = ("R") end end end game:GetService("UserInputService").InputBegan:connect(ChangeFeet)
InputBegan
returns an InputObject
that has the property KeyCode
. I see that you used it in your print statement. Also I would recommend using localplayer
for locating the gui.
A = Game.Players.LocalPlayer.PlayerGui.ChooseFoot.CFF.CF function ChangeFeet(CF) if CF.KeyCode == Enum.KeyCode.LeftAlt then if A.Text == ("R") then A.Text = ("L") elseif A.Text == ("L") then A.Text = ("R") end end end game:GetService("UserInputService").InputBegan:connect(ChangeFeet)