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

Moving frame help?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

I have a frame in startergui and in the frame I have a imagelabel. So what this does it makes the frame move from left to right and continuing. I want it to hit the left side of the screen and not come back.

Startposition=script.Parent.Position

while true do
    local RightBorder=script.Parent.AbsolutePosition.X+script.Parent.AbsoluteSize.X
    if RightBorder<=0 then
        script.Parent.Position=Startposition
    else
        script.Parent.Position=script.Parent.Position-UDim2.new(0.005,0,0,0)
    end
    wait()
end
0
I'd recommend using tweenposition ;) http://wiki.roblox.com/index.php?title=TweenPosition Ryzox 220 — 9y

1 answer

Log in to vote
1
Answered by
Ryzox 220 Moderation Voter
9 years ago
script.Parent:TweenPosition(UDim2.new(-1,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,1,false)

To understand each argument check the wiki

http://wiki.roblox.com/index.php?title=TweenPosition

bool TweenPosition ( UDim2 endPosition, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, void function() callback = nil )

Ad

Answer this question