Understanding The Code

  1. What do you want to achieve? Understanding the purpose of the info portion.

  2. What solutions have you tried so far? I’ve looked through the Engine API and I still can’t understand the purpose of info. (I’ve looked at the following)
    TweenInfo
    TweenService

The Code:

local info = TweenInfo.new(1,Enum.EasingStyle.Quart, Enum.EasingDirection.InOut)
local function Tween(object, value)
	local OutTween = game:GetService("TweenService"):Create(object,info,{TextTransparency = value})
	--Basically object; is referring to the text being created; line 15, creating the text
	--info idk
	--TextTransparency is the transparency levels
	OutTween:Play()
end
local dialogue1 = script.Parent.whatcanI
local dialogue2  = script.Parent.goodchoice
game.ReplicatedStorage.Touch.OnClientEvent:Connect(function() -- Fires event on Interaction
	if true then -- Dialogue1 Tweens
		Tween(dialogue1,0)
		dialogue1:TweenPosition(UDim2.new(0, 0,0.034, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quart)
		wait(3)
		Tween(dialogue1,1)
		dialogue1:TweenPosition(UDim2.new(0, 0, 0.487, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quart)
		wait(1)
	end
end)
game.ReplicatedStorage.Left.OnClientEvent:Connect(function() --Fires event on leaving
	if true then -- -- Dialogue2 Tweens
		Tween(dialogue2,0)
		dialogue2:TweenPosition(UDim2.new(0, 0,0.034, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quart)
		wait(3)
		Tween(dialogue2,1)
		dialogue2:TweenPosition(UDim2.new(0, 0, 0.487, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quart)
		wait(1)
	end
end)

What do you mean understanding the code and the info portion? Are you talking about TweenInfo.new()?

As what @coo1ifyy stated, what are you trying to achieve? Please provide more context of the code/script so we can understand better and help you as well.

I mean yes, I’m referring to local info on line 1 and its use on line 3 in local OutTween.

TweenInfos are like properties of a Tween. So the time the twen time, the easing style & direction.

If that is what your asking?

Now that you explain it like that about TweenInfos being properties towards Tweens it makes a lot more sense. Sorry if my question sounded a bit dumb, I’m new to Roblox and Lua entirely. Thanks again!

1 Like

No problem, glad I could help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.