I'd like to know how this script is completely successful in local, but not as a server based script. It involves a morph with added parts that are supposed to turn transparent, with another group of parts turning non-transparent. While it does that upon usage of the tool, when the tool is deselected, the parts do not revert to their original placement as a normal ROBLOX script. Tried configuring with parameters, but that did not seem to work. Is there perhaps a missing configuration in mouse function?

function changeTransparency(parentModel, partName, transparency)
        local C = parentModel:GetChildren()
        for i=1, #C do
            if C[i].className == "Model" then
                local CM = C[i]:GetChildren()
                for j=1, #CM do
                    if CM[j]:IsA("BasePart") and CM[j].Name == partName then
                        --script.Parent.Parent.Parent.Character.Chest.A8.CanCollide=false
                        CM[j].Transparency = transparency
                    end
                end
            end
        end
end

function onSelected(mouse) 

    changeTransparency(script.Parent.Parent.Parent.Character,"Part",1)
    changeTransparency(script.Parent.Parent.Parent.Character,"Part1",0)
    

end 


function onDeselected()
    
    changeTransparency(script.Parent.Parent.Parent.Character,"Part",0)
    changeTransparency(script.Parent.Parent.Parent.Character,"Part1",1)

    
end 

script.Parent.Selected:connect(onSelected)
script.Parent.Deselected:connect(onDeselected)