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

Does Roblox not allow surface change "Effects" to happen? (Read for info)

Asked by 9 years ago

I have a script in a vehicle that will make a part that it hits become all SmoothNoOutlines instead of weld, yet it doesn't detaches itself. It's welded with the Weld surface, not a Weld script! Here's my script:

sp = script.Parent
Parts = {"Part","Wedge","Truss","Brick","part","CornerWedge"}

for i,v in pairs(Parts) do
    sp.Touched:connect(function(Hit)
        if Hit.Name == v then
            wait()
            Hit.BackSurface = "SmoothNoOutlines"
            wait()
            Hit.BottomSurface = "SmoothNoOutlines"
            wait()
            Hit.FrontSurface = "SmoothNoOutlines"
            wait()
            Hit.LeftSurface = "SmoothNoOutlines"
            wait()
            Hit.RightSurface = "SmoothNoOutlines"
            wait()
            Hit.TopSurface = "SmoothNoOutlines"
        else
            print("Condition is Not Met")
        end
    end)
end

I was thinking that I might need to do something like using CFrame and add a very small amount to make it detach itself instead. Would that be better then using SmoothNoOutlines?

1 answer

Log in to vote
2
Answered by
Tkdriverx 514 Moderation Voter
9 years ago

Try just using Hit:BreakJoints() instead of setting the surfaces. This will break the connection it has with other parts and fall off without changing the surfaces.

Ad

Answer this question