If i create a part with a localscript can it be used in other local scripts?
I’d assume so, as long as they’re handled on the Local Side & named fine
local Part = Instance.new("Part")
Part.Name = "ThisIsAPart"
Part.Parent = workspace
--Other LocalScript
local Part = workspace:WaitForChild("ThisIsAPart")
print(Part)
Ok, but then why does this return nil, and how could i solve it?
local ObjectToClone = game.Workspace.Ignore:WaitForChild("SelectBox"):FindFirstChildWhichIsA("ObjectValue").Value
Yes. So long as the LocalScripts in question are running from the same client.
Try doing this instead
local Object = workspace.Ignore:WaitForChild("SelectBox")
local Check = Object:FindFirstChildWhichIsA("ObjectValue")
if Check then
print("Yes")
else
print("No")
end
It prints out no :((
Oh wait looking at the picture you should be attempting to get through all of the Descendants, you’re attempting to find something inside the SelectBox
alone which keeps returning back nil
cause there’s no ObjectValue
inside the SelectBox’s Children when you should be searching inside the Model instead
local Object = workspace.Ignore:WaitForChild("SelectBox"):WaitForChild("ModelToPlace")
local Check = Object:FindFirstChildWhichIsA("ObjectValue")
if Check then
print("Yes")
else
print("No")
end
wasn’t :FindFirstDescendantWhichIsA()
a thing?
I believe you might be referring to this?
Weird, I swear i have used the function at least once i swear.
As long as the other scripts that want to use the part are also local scripts then you should be fine.
Yes