-
What do you want to achieve?
I want too make the tween play with a bindable event. -
What is the issue?
The event fires but the local script doesn’t seem too pick it up. -
What solutions have you tried so far?
Asking in discord servers, using other’s code, and messing around with it.
First script that fires the event
local replicatedStorage = game:GetService("ReplicatedStorage")
local dialogUpEvent = replicatedStorage:WaitForChild("dialogUp")
local TweenService = game:GetService("TweenService")
local frame = script.Parent
local targetPosition = UDim2.new(0.161, 0, 0.845, 0) -- Move the frame up by 50% of its size
-- Define the tween properties
local tweenInfo = TweenInfo.new(
2, -- Duration (in seconds)
Enum.EasingStyle.Quad, -- Easing style (you can experiment with different styles)
Enum.EasingDirection.Out, -- Easing direction
0, -- Delay (in seconds)
false, -- Reverses the tween
0 -- Repeats (set to 0 for no repeats)
)
-- Create the tween
local tweenUP = TweenService:Create(frame, tweenInfo, { Position = targetPosition })
-- Listen for the event to trigger the tween
dialogUpEvent.Changed:Connect(function()
print("Received dialogUpEvent. Playing tween.")
tweenUP:Play()
end)
Local script in UI
local replicatedStorage = game:GetService("ReplicatedStorage")
local dialogUpEvent = replicatedStorage:WaitForChild("dialogUp")
local TweenService = game:GetService("TweenService")
local frame = script.Parent
local targetPosition = UDim2.new(0.161, 0, 0.845, 0) -- Move the frame up by 50% of its size
-- Define the tween properties
local tweenInfo = TweenInfo.new(
2, -- Duration (in seconds)
Enum.EasingStyle.Quad, -- Easing style (you can experiment with different styles)
Enum.EasingDirection.Out, -- Easing direction
0, -- Delay (in seconds)
false, -- Reverses the tween
0 -- Repeats (set to 0 for no repeats)
)
-- Create the tween
local tweenUP = TweenService:Create(frame, tweenInfo, { Position = targetPosition })
-- Listen for the event to trigger the tween
dialogUpEvent.Changed:Connect(function()
print("Received dialogUpEvent. Playing tween.")
tweenUP:Play()
end)
wait(5)
tweenUP:Play()