I've been attempting to make my own /name script. It's been going fine until this happened: https://gyazo.com/eb1732b08734164f26089b2fd6d2190a
Here's the line of code that changes the text:
local function NameChange(player, text) local character = player.Character character.Head.RPName.Text.Text = unpack(text) print(unpack(text)) end
Help?
This isn't an issue with the script, but actually with how unpack works...
Essentially, for a lot of functions in roblox, they can have multiple returns, such as game.Workspace:FindPartOnRay(...), which returns a part, a hit position, and a part normal.
This works on a very similar concept. Essentially, it's returning an entire list of table elements, but print can only accept one when put in that format, so it'll appear as if it's not unpacking the entire table. In reality, the print just excludes the other elements outside the very first, making this issue appear as such.
Please leave any comments, corrections, or any suggestions on what to add in the comments below.
Edit: It was requested that I also show a method of combining a table of strings into a single string:
local StringThing for _,v in pairs(StringTable) do StringThing = StringThing .. v end print(StringThing)