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

how to delete parent (for assigned object) of ObjectValue?

local target = game.Workspace.SaveObject.Value
local id = game.Workspace.ack.Value

while wait() do
if workspace:FindFirstChild("ttest") then
	print("Destroying object...")
	if game.Workspace:FindFirstChild(game.workspace.ack.Value).Name == game.workspace.ack.Value then
		game.Workspace.ack.Value.Parent:Destroy()
	end
end
end

ack is a objectvalue and script deleets when ttest exists

1 answer

local target = game.Workspace.SaveObject.Value
local id = game.Workspace.ack.Value

while wait() do
if workspace:FindFirstChild("ttest") then
print("Destroying object...")
if id then
id.Parent:Destroy()
end
end
end

(Not tested in studio might not be 100% accurate)

6 comments

0

Came back with the nil value error :p

0

What have u set the value of the object too?

0

a model

0

ok i see

0

Edited code try now

0

code? (btw i meant part in model)

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