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

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

Asked by
chafava -113
4 years ago
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

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
4 years ago
Edited 4 years ago
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)

0
Came back with the nil value error :p chafava -113 — 4y
0
What have u set the value of the object too? Prestory 1395 — 4y
0
a model chafava -113 — 4y
0
ok i see Prestory 1395 — 4y
View all comments (2 more)
0
Edited code try now Prestory 1395 — 4y
0
code? (btw i meant part in model) chafava -113 — 4y
Ad

Answer this question