Introducing SmartShutdown!

Hello there! Today I am happy to present to you this little tool, which can help you make updates for your game, and your users won’t have to rejoin!

NOTE: PLEASE SCROLL DOWN FOR NEW UPDATES
Link: SmartShutdown - Roblox

Visual:

(OLD)
New visual: SmartShutdown Visual (Devforum) - YouTube

Source code:
image

--main module
local module = {}

function module.Initialize()
	
	game:BindToClose(function()
		local party = game.Players:GetPlayers()
		local UiClone = script.Update
		if UiClone then
			for i, plr in pairs(party) do
				local newClone = UiClone:Clone()
				newClone.Parent = plr.PlayerGui
				local animationManager = newClone:WaitForChild("animationManager")
				animationManager.Disabled = false
			end

			if #party >= 1 then
				game:GetService("TeleportService"):TeleportPartyAsync(module.PlaceId, party, nil, UiClone)
			end
		end
	end)	
end


return module

image

--local script in the GUI. 


--ADD EFFECTS HERE, USE A SPAWN FUNCTION, COROUTINE, OR TWEENING

--ADD EFFECTS HERE, USE A SPAWN FUNCTION, COROUTINE, OR TWEENING
--THIS SCRIPT WILL BE PARENTED TO THE GUI, SO script.Parent IS THE GUI ITSELF.
local TS = TweenInfo.new(1, Enum.EasingStyle.Exponential)
script.Parent.Frame.Transparency = 1
local tween = game:GetService("TweenService"):Create(script.Parent.Frame, TS, {Transparency = 0})
tween:Play()
local blur = script.Parent.Blur
blur.Parent = game.Lighting
blur.Enabled = true
script.Parent.Frame["Red Vs Blue Hammer Cartoon"].Playing = true


Documentation:

I recommend putting the module in ReplicatedStorage. You can get the module by using the command:

local SmartShutdown = require(game.ReplicatedStorage:WaitForChild("SmartShutdown"))--can be any name that you have named it in RS.

NOTE: With the new update, the GUI is now in the module. Go through the scripts for more info!
Your placeID:

SmartShutdown.placeId = PlaceIdHere

To start, or initialize, use this:

SmartShutdown:Initialize()

How would I add effects?

So, when adding effects, it is recommended that you have some knowledge of scripting.
Here’s an example of a simple fade-in effect:


local TS = TweenInfo.new(1, Enum.EasingStyle.Exponential)
script.Parent.Frame.Transparency = 1
local tween = game:GetService("TweenService"):Create(script.Parent.Frame, TS, {Transparency = 0})
tween:Play()

You can use a spawn function, coroutine, or tweening, which is much more advanced!

Thanks for reading! I hope this module will help you make future updates without having your users rejoin. I use it in my game currently (it’s not out yet)

EDIT: If you want more advanced effects, use [tweeting.]

Update: Version: 1.01
Now, if you want to add effects, use the local script parented to the module, it’s called “animationManager”.
(TweenService)
Update: Version 1.02
Now all the UI is in the module!
Update: Version 1.03
Have used your suggestions in order to improve the module!

38 Likes

I believe this is also known as a “soft shutdown”. This does seem a bit annoying to do but maybe it’ll be useful to some people! Good job.

4 Likes

Yes! It is also called that. I was just thinking of other names.

1 Like

Nice, might be useful in some games!

1 Like

SoftShutdown is a script Merely made a few years ago. Why do you think people should use SmartShutdown as opposed to it?

3 Likes

Good job!

I’ve been looking for something like this for ages.

1 Like

This is awful. Not only are you using spawn a wait for effects, but you’re using a for loop to animate. And, it’s BackgroundTransparency for a frame, not Transparency.

Use TweenService.

-- Assuming TweenService is a variable for the service, and TI is a TweenInformation instance.
local Animation = TweenService:Create(newClone.Frame,TI,{BackgroundTransparency = 1})
Animation:Play()

That aside, I have no use for this. Instead, I can use a Soft-Shutdown script by Merely, and modify it to include a UI.

And, seeing the code you use in the example, I would not trust the work to be of quality.

1 Like

Sure, your opinion. I don’t believe tweening is better for my case, and the “Transparency” property works just fine, I believe roblox added that in scripts, since now I can just use transparency to control the children’s transparency too. Tweenservice can be used for effects too. I don’t see the difference. When doing a simple fade effect, that won’t generate a difference.

Tweening is better as it’s technically smoother and it gives you a vast amount of additional control over it, such as easing styles, directions, and a set time.

5 Likes

Of course. Yet, I was making a fade-in effect, and for that reason, I didn’t need to use a tween. Both would work, though!

How so? In my case, using a spawn function won’t affect anything, since a wait is 0.03 seconds. If you don’t want to use a wait, then you can use coroutines.

Wrong. You are creating a psuedo-thread on the 30hz processor, affected by memory usage and etc.

Also wrong. wait can be any amount of time.

2 Likes

A wait without an argument takes up 0.03 seconds.

Using 6 spawn functions at the same time won’t affect the performance. Trust me, I’ve tested it before.
But, if you have tons of pseudo-threads running, it might be difficult for the processor.

Where did you get the number 30hz?

I’m telling you what developers such as myself get using benchmarking tools. 0.03 is only a rough estimate, if everything goes smoothly. Anybody can print the result of wait() and see how it can vary in time.

It’s what Roblox uses for internal processing. This applies to wait(), spawn, DebrisService, etc.

I didn’t say it would affect memory usage, I said:

affected by memory usage

1 Like

Oh, sorry. Well, I agree with that. That’s why I mentioned coroutines, however, those would be affected by memory usage too. In my case, I don’t think it will matter. On the other hand, tweening is the same process. But, you could improve it by firing an event to the client. This could effect how fast it will show for the client. But I think in this case, everything would work.

Are you not already doing the fade animation on the client?

1 Like

Not sure what you mean. I use spawn functions on the server in order to create the animations. But of course, I am applying the animations to the client’s gui.

Same goes with CloneTrooper’s as well, most people use SoftShutdown so why would there need to be another version of SoftShutdown that does pretty much the same thing??

4 Likes

I didn’t even know that existed. It just came out my head. Thanks for letting me know!

2 Likes