ramdoys
(Ram)
March 5, 2023, 5:57am
#1
I only want this to run once, but it keeps looping over itself and I have no clue why. Here’s my code and a video.
local ts = game:GetService("TweenService")
local player = game:GetService("Players").LocalPlayer
local REMs = game:GetService("ReplicatedStorage").REMs
local components = {
script.Parent.MenuBack.OpeningAssets.StudioIntroduction,
script.Parent.MenuBack,
script.Parent.MenuBack.UIGradient
}
script.Parent.MenuBack.Username.Text = player.DisplayName.."(@"..player.Name..")"
local tweeninfo1 = TweenInfo.new(
3,
Enum.EasingStyle.Quad,
Enum.EasingDirection.In
)
local transText = ts:Create(components[1],
tweeninfo1,
{TextTransparency=1} )
local transColor = ts:Create(components[2],
tweeninfo1,
{BackgroundColor3 = Color3.new(255,255,255)}
)
local function intro()
components[1]:TweenSize(UDim2.new(1,0,0.15,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad, 8)
transText:Play()
wait(6)
components[1]:Destroy()
transColor:Play()
end
intro()
Could you put it in a better format to read? Like take a screen shot of your code
ramdoys
(Ram)
March 5, 2023, 5:58am
#3
im so sorry, i accidentally posted it before finishing. how do i make it into a lua block of code?
I don’t really know how to put it in a lua block of code, so I usually take screen shots of my code for help when I use the dev form.
ramdoys
(Ram)
March 5, 2023, 6:00am
#5
fixed it for you (mmmmmmmmmmmm)
In your TweenInfo1, your missing some info.
1 Like
ramdoys
(Ram)
March 5, 2023, 6:04am
#7
ohhh thank you so much for the help. i didnt know you had to define that lol
ramdoys
(Ram)
March 5, 2023, 6:06am
#8
wait, that didnt fix it sadly i dont know why
Try using transtext.Completed:Wait()
1 Like
ramdoys
(Ram)
March 5, 2023, 6:10am
#10
Thanks so much, it works properly now!
ramdoys
(Ram)
March 5, 2023, 6:11am
#11
oh my god it keeps looping why. it extends to the new part now, but then it just loops over the function again. its as if all the previous changes didnt exist, and it goes back in time to redo them all over again
This is a resize gui that I created inside my game, that works and only runs one time. Im unsure how to help you any further but I hope this example helps a little bit.
1 Like
ramdoys
(Ram)
March 5, 2023, 6:16am
#13
thanks, i dont even know why thats happening. ive never encountered that before, it might be a bug but id highly doubt it
ramdoys
(Ram)
March 5, 2023, 6:24am
#14
i just realized why it wasnt working lol. i had intro not connecting to anything, and it was just there infinitely looping over itself
1 Like
system
(system)
Closed
March 19, 2023, 6:25am
#15
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.