Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Identifying Objects Problem. Help?

Asked by 9 years ago

I'm making a script that puts a zombie in a random position.


local windownumber = script.Parent.window.Value -- this is in the zombie, a string value local window = game.Workspace.windownumber -- find which window to go to

My question is, how do I make it so local window = game.Workspace.windownumber does not think it's looking for the object called "windownumber" in the workspace, but to look for the value's name, not "windownumber" the object?

0
I think I worded this wrong, I'm trying to figure out how to look for the the value of local windownumber = script.Parent.window.Value in the workspace. slicer39alt 5 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

To search for a string, do this:

game.Workspace["name"]

or

game.Workspace:FindFirstChild("name") -- or, :WaitForChild()
Ad

Answer this question