for example
local player = game.Players.LocalPlayer
local something = player.Name
local DESTROY = game.workspace.something:Destroy()
How do you search for a child's name by using a variable?
for example
local player = game.Players.LocalPlayer
local something = player.Name
local DESTROY = game.workspace.something:Destroy()
How do you search for a child's name by using a variable?
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Where it says "something" inside the script it thinks I'm literally searching for a child called something rather then the child, why?
So the variable something in this scenario is a string. To search for something in the workspace you can use game.Workspace:FindFirstChild(something) Or WaitForChild(something). Also FindFirstChild or WaitForChild(“namewithoutvariable”). So final product would be Local Destroy = game.Workspace:WaitForChild(something):Destroy()