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

How do you destroy the object that is in the model ?

Asked by
Bulvyte 388 Moderation Voter
8 years ago

As the title says i am having problems with this script read below

        local object = script.Parent.Purchases:FindFirstChild(v.Object.Value)
        if object ~= nil then
            objects[object.Name] = object:Clone()
        else
            print("Button: "..v.Name.." is missing its object and has been removed.")
            v.Head.CanCollide = false
            v.Head.Transparency = 1
        end


        v.Head.Touched:connect(function(hit)
                        object.Transparency = 1 -- problem here it locates the model but how can i locate the model's part inside the model ? I cannot write it's name because this script is for all buttons im using.
                        object.CanCollide = true
                        objects[v.Object.Value].Parent = script.Parent.RemovedObjects

Answer this question