I have a script that's supposed to display a parts name in a text GUI. This is particularly useful because the name could be different every time. However, I always get returned with "bad argument #3 (string expected, got nil)"
local name = game.Workspace.key.part.Name wait(0.2) -- ignore this script.Parent.dialogue.Text = name
You can try to fix this by not directly assigning properties and yielding. This code here should work:
local Key = game.Workspace:WaitForChild("key") local Part = Key:FindFirstChild("part") if Part then script.Parent.dialogue.Text = Part.Name end
It seems you might have an extra property in your variable, so try:
local name = game.Workspace.key.Name
Or try:
local name = game.Workspace.part.Name