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

Identifying Objects Problem. Help?

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?

1 comment

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.

1 answer

To search for a string, do this:

game.Workspace["name"]

or

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

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