I tried to do
if workspace.Part then print("1") else instance.new("Part").Parent = workspace end
it said Part isn't a member of workspace
I tried to do
if workspace.Part then print("1") else instance.new("Part").Parent = workspace end
it said Part isn't a member of workspace
If you know the part is either there or isn't there
local Part = workspace:FindFirstChild("PartName")
Or, if you want it as soon as it appears, and it's certain to appear:
local Part = workspace:WaitForChild("PartName")
if Part then
...
end
if workspace:FindFirstChild("Part") then
if workspace:FindFirstChild("Part") == nil then
if workspace:FindFirstChild("Part") then
print("1")
end
if workspace:FindFirstChild("Part") == nil then
Instance.new("Part").Parent = game.Workspace
end
This discussion is preserved as it was. New answers, comments, and votes are closed.