I am trying to make a Surface GUI which shows a players name if you run a command such as: “!pass UserName”. I have wrote the code, however it errors and doesn’t work. The ONLY error message is shows is: “Attempted to index Boolean with ‘Text’.” This is the code it errors on, the LAST line is the line it says it errors on, the last line is:
local Clone = Template:Clone().Parent == Frame
Clone.Text = NameOfVictim
I do not understand why it errors, however it errors when I say “Clone.Text = NameOfVictim” NameOfVictim is just a string variable I created which is the name of the player we are running the command on.
That’s because the clone variable is a boolean. You’re checking if the parent of the clone is frame. The clone variable is always false since the parent is nil.
local SplitMessage = Message:split(" ")
local NameOfVictim = SplitMessage[2]
local victim = game.Players:FindFirstChild(NameOfVictim)
local Reason = Message:split(NameOfVictim)[2]