Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I want the display to display the script.Parent's name but it doesn't work?

script.Parent.MouseButton1Click:connect(function()
	 local map1 = game.ServerStorage.script.Parent.Name:Clone()
 map1.Parent = game.Workspace
game.Workspace.Display.MapName.Main.Body.Text = script.Parent.Name
CreateTeam()
end)

It starts from local map1 = and ends on that line

1 answer

✓ Accepted answer

You can't search for something like that, instead:

local map1 = game.ServerStorage:FindFirstChild(script.Parent.Name) -- looks for a child with the name of script's parent
if map1 then -- if it has been found
	map1 = map1:Clone() -- clones it
end
-- you can continue as normal now

Hope I helped!

~TDP

This discussion is preserved as it was. New answers, comments, and votes are closed.