Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[FE] How would I make this smoothly open up?

I'v been trying to make a Window for a very long time now but can't figure it out. I perfer Cframes over vectors. The script is in a Server Script, like I said it is Filtering Enable. Whenever I try to make the window open/close it never works. Is there any way I can fix this problem? Code:

local TweenService = game:GetService ("TweenService")
local Window = script.Parent.Parent.Window
local Frame = script.Parent.Parent.Frame
local Open = false

local TweeningInformation = TweenInfo.new(
	
	1, --How long this takes--
	Enum.EasingStyle.Linear
	Enum.EasingDirection.Out
	0, --How many times it will repeat if repeating is true--
	false, --If it should repeat
	0 --delay between tween--
)
local WindowOpen = {CFrame = CFrame.new(-62.75, 5, -92.25)}
local WindowClose = {CFrame = CFrame.new(-62.75, 5, -88.35)}
local FrameOpen = {CFrame = CFrame.new(-62.75, 5, -92.25)}
local FrameClose = {CFrame = CFrame.new(-62.75, 5, -88.35)}
local Tweenopenwindow = TweeningInformation:Create (Window,TweeningInformation,WindowOpen)
local Tweenclosewindow = TweeningInformation:Create (Window,TweeningInformation,WindowClose)
local TweenopenFrame = TweeningInformation:Create (Frame,TweeningInformation,FrameOpen)
local TweencloseFrame = TweeningInformation:Create (Frame,TweeningInformation,FrameClose)

function OnMouseClick()
	if Open = false then
	Tweenopenwindow:play()
	TweenopenFrame:play()
	else
		Tweenclosewindow:play()
		TweencloseFrame:play()
end
script.Parent.ClickDetector.MouseClick:connect (OnMouseClick)

1 answer

✓ Accepted answer

In your code, you missed an end

local TweenService = game:GetService ("TweenService")
local Window = script.Parent.Parent.Window
local Frame = script.Parent.Parent.Frame
local Open = false

local TweeningInformation = TweenInfo.new(

    1, --How long this takes--
    Enum.EasingStyle.Linear
    Enum.EasingDirection.Out
    0, --How many times it will repeat if repeating is true--
    false, --If it should repeat
    0 --delay between tween--
)
local WindowOpen = {CFrame = CFrame.new(-62.75, 5, -92.25)}
local WindowClose = {CFrame = CFrame.new(-62.75, 5, -88.35)}
local FrameOpen = {CFrame = CFrame.new(-62.75, 5, -92.25)}
local FrameClose = {CFrame = CFrame.new(-62.75, 5, -88.35)}
local Tweenopenwindow = TweeningInformation:Create (Window,TweeningInformation,WindowOpen)
local Tweenclosewindow = TweeningInformation:Create (Window,TweeningInformation,WindowClose)
local TweenopenFrame = TweeningInformation:Create (Frame,TweeningInformation,FrameOpen)
local TweencloseFrame = TweeningInformation:Create (Frame,TweeningInformation,FrameClose)

function OnMouseClick()
    if Open = false then
	    Tweenopenwindow:play()
	    TweenopenFrame:play()
    else
    	Tweenclosewindow:play()
        TweencloseFrame:play()
	end -- You missed this one
end
script.Parent.ClickDetector.MouseClick:connect (OnMouseClick)

1 comment

0

Didn't work again. I'm just going to ask my freind for help now and post the answer later on for anyone else who needs help.

This discussion is preserved as it was. New answers, comments, and votes are closed.