Hi, I’m Trying to make System that makes the frame white and then into gray frame and back into a white frame and make the button go down a little then back up. here’s a script that shows what i’m talking about:
local frame = script.Parent
local button = script.Parent.Parent
local function onButtonActivated()
frame.BackgroundColor3 = Color3.fromRBG(150, 150, 150) --this isn't working
TweenPosition(UDim2.new(()),EasingStyle,EasingDirection) --how do i do this?
task.wait(0.5)
frame.BackgroundColor3 = Color3.fromRBG(255, 255, 255) --this isn't working
TweenPosition(UDim2.new(()),EasingStyle,EasingDirection) --how do i do this?
end
button.Activated:Connect(onButtonActivated)
i would like it if someone helped me.
Like this?
while wait(2) do
game.TweenService:Create(script.Parent.ScreenGui.Grey, TweenInfo.new(2), {Transparency = 0}):Play()
game.TweenService:Create(script.Parent.ScreenGui.Grey, TweenInfo.new(2), {Position = script.Parent.ScreenGui.Grey.Position - UDim2.new(0, 0, 0.1)}):Play()
game.TweenService:Create(script.Parent.ScreenGui.White, TweenInfo.new(2), {Position = script.Parent.ScreenGui.White.Position - UDim2.new(0, 0, 0.1)}):Play()
wait(2)
game.TweenService:Create(script.Parent.ScreenGui.Grey, TweenInfo.new(2), {Transparency = 1}):Play()
game.TweenService:Create(script.Parent.ScreenGui.Grey, TweenInfo.new(2), {Position = script.Parent.ScreenGui.Grey.Position + UDim2.new(0, 0, 0.1)}):Play()
game.TweenService:Create(script.Parent.ScreenGui.White, TweenInfo.new(2), {Position = script.Parent.ScreenGui.White.Position + UDim2.new(0, 0, 0.1)}):Play()
end
1 Like
This isn’t working because it’s Color3.fromRGB (you have RBG)
You need to give it a new position to move to. You also need to add the button at the beginning. The easing style and direction are the other way around (Direction first then style), you also need to give it a length of time to run for at the end:
button:TweenPosition(UDim2.fromScale(.5,.5),Enum.EasingDirection.In,Enum.EasingStyle.Sine, 2)
You can find out more about TweenPosition and how to use it here:
1 Like