How to use if statement multiple times?

So I’m making something that basically has the same if statement played over but I basically want to turn it into something I can define like a local, how can I do that? I can’t seem to find anything on it. Here’s my code:

	if Tween18.PlaybackState == Enum.PlaybackState.Completed then
		ReplaceContinue.Visible = false
		Continue.Visible = true
	end
3 Likes
function checkThePlayState()
    if Tween18.PlaybackState == Enum.PlaybackState.Completed then
		ReplaceContinue.Visible = false
		Continue.Visible = true
	end
end

Something like that? Sorry if it’s not helpful, I’m not sure what you’re trying to do.

I’m a bit concerned that you have a variable called “Tween18”, smells like non- DRY code :sushi: but maybe it’s fine

1 Like

I forgot functions exist. :man_facepalming: Anyways thanks for helping me!

1 Like

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