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

Size decreasing to Center instead of Bottom?

Asked by
KenzaXI 166
7 years ago

Hi, I've made a script to open a Door by decreasing the size of the door, the only problem is I can't seem to control from where the size is decreasing. Every-time it decreases, it's from the top and bottom and decreasing to the center instead of decreasing from and to just 1 direction.

here is the Code:

local MDoor = script.Parent
local handle = script.Parent.Parent.Handle
game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg)
        if msg == "Open Door" then
            repeat
            MDoor.Size = MDoor.Size - Vector3.new(0, 1, 0)
            handle.Position = handle.Position - Vector3.new(0, 1, 0)
            wait(0.4)
            until 
            MDoor.Size == Vector3.new(36, 1, 2)
            and handle.Position == Vector3.new(1406, 16, 644.5)
        end
    end)
end)

Thanks.

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
7 years ago

http://wiki.roblox.com/index.php?title=API:Class/BasePart/Resize

Can size the part in one direction like studio tools.

0
Thanks, would you be able to give an example of how the Resize works? The wiki didn't give a way of how to use it. KenzaXI 166 — 7y
0
MDoor:Resize(Enum.NormalId.Top,-1) cabbler 1942 — 7y
Ad

Answer this question