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

Is there a method of changing every surface of an object all at once?

Asked by 8 years ago

This is for convenience, and I don't necessarily specifically mean surfaces, but if there is a way to change all of a type of property at once it would be nicer than setting up a string and basically doing the same thing you would have anyways.

1 answer

Log in to vote
1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
8 years ago

There is no pre-existing method to do this, but you can always write a function so that you can call it on any object:

local function changeSurfaces(object, surfaceEnum)
    if object:IsA("BasePart") then
        object.TopSurface = surfaceEnum
        object.BottomSurface = surfaceEnum
        object.FrontSurface = surfaceEnum
        object.BackSurface = surfaceEnum
        object.LeftSurface = surfaceEnum
        object.RightSurface = surfaceEnum
    end
end

changeSurfaces(game.Workspace.BasePlate, Enum.SurfaceType.Smooth) --Usage Example
Ad

Answer this question