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

Unable to change surface type after using local parts?

Asked by 6 years ago

So what I have is a game with local parts, but when I clone it, It just decides to break and no surface type appears, even when I change it beforehand. I tried to make it work with scripts, but its not doing anything. Here's my code:

-- turn things into local parts
local clone = game.Workspace.Model:Clone()
game.Workspace.Model:Destroy()
clone.Parent = game.Workspace
-- change all surface types into studs
wait(1)
for _,v in pairs(clone:GetChildren()) do
    if v:IsA("Part") then
        v.FrontSurface = Enum.SurfaceType.Studs
        v.BackSurface = Enum.SurfaceType.Studs
        v.RightSurface = Enum.SurfaceType.Studs
        v.LeftSurface = Enum.SurfaceType.Studs
        v.TopSurface = Enum.SurfaceType.Studs
        v.BottomSurface = Enum.SurfaceType.Studs
    end
end

Answer this question