I'm not really good at C-frame and i'm really having a difficulties on it. Can someone help me out?

Here's the script:

local Part = script.Parent -- Variable of part
local PartPos = Part.CFrame.y -- The Y axis of Part's Position 
local MaxHeight = PartPos + 0.5 -- Heightest point is 10 extra studs above current part position
local LowestHeight = PartPos - 0 -- Lowest point is minus 0 studs
while wait() do -- Start infinite loop

for Y = PartPos, MaxHeight, .05 do -- Start at PartPos going to MaxHeight by an interval of .1 
Part.CFrame = CFrame.new(Part.CFrame.x, Y, Part.CFrame.z)
wait(.05)
end
local PartPos = Part.CFrame.y
for Y = PartPos, LowestHeight, -.05 do -- Start at PartPos going to Lowest Height by an interval of .1
Part.CFrame = CFrame.new(Part.CFrame.x, Y, Part.CFrame.z)
wait(.05)
end
local PartPos = Part.CFrame.y
end

Thank you for spending your time helping me. It's mean a lot to me.

4 comments

0

So what's the problem?

0

Hi, thank you for asking. Well, the problem is that I want to add C-frame to the brick. Like I want to rotate the brick by using C-frame.

0

CFrame.Angles is generally used for rotation. You can get a complete tutorial on the wiki: http://wiki.roblox.com/index.php?title=CFrame

0

Thanks for the help! I'll check it out and give it a try. :D