hello, so i was making a script with tweens and i got this error
TweenPosition is not a valid member of ScreenGui "Players.dashypoo17.PlayerGui.MainMenu"
heres the script
local Gui = script.Parent.Parent
script.Parent.MouseButton1Click:Connect(function(clicked)
Gui:TweenPosition(UDim2.new(0,0,1,0), "InOut", "Sine",3.5)
for i = 1,25 do
wait (0.05)
game.Lighting.Blur.Size = game.Lighting.Blur.Size - 3
end
end)
local TS = game:GetService("TweenService")
local Gui = script.Parent.Parent
script.Parent.MouseButton1Click:Connect(function(clicked)
TS:Create(Gui,TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Position = Udim2.New(0,0,1,0)}):Play()
for i = 1,25 do
wait (0.05)
game.Lighting.Blur.Size = game.Lighting.Blur.Size - 3
end
end)
If that doesnt work make sure you are picking a “Frame” or whatever that can be moved and not a “ScreenGui”
local TS = game:GetService("TweenService")
local Gui = script.Parent.Parent:WaitForChild("MainFrame")
script.Parent.MouseButton1Click:Connect(function(clicked)
TS:Create(Gui,TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Position = UDim2.New(0,0,1,0)}):Play()
for i = 1,25 do
wait (0.05)
game.Lighting.Blur.Size = game.Lighting.Blur.Size - 3
end
end)
local ui = script.Parent.Parent
script.Parent.MouseButton1Click:Connect(function(click)
ui:TweenPosition(UDim2.new(0,0,1,0), "InOut", "Sine",0.5)
for i = 1,25 do
wait (0.01)
game.Lighting.Blur.Size = game.Lighting.Blur.Size - 3
end
end)