How do you reload a game from a script?

Is there any way to reload a game from a script?

I want the map and every object to reset to where it is initially, when you first load into the server.

I’ve tried to use loadCharacter() which loads the character again, but does nothing to the game itself.

You need to create function that resets your map and object inside of that map.
For example your function can work like:
Parenting the Folder with the Builds inside of it, inside of ReplicatedStorage! Whenever Player joins by using PlayerAdded event and CharacterAdded event together, you can create a function and call a Reset() function in there, which will Parent the map to the ReplicatedStorage!

-- [Server Script] --


-- Services

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

-- Variables --

local Map_Folder = game.Workspace.Map_Folder

local function Reset()
	Map_Folder.Parent = ReplicatedStorage
end

Players.PlayerAdded:Connect(function(Player) -- PlayerAdded Event Will Give Back The Player So We Can Use CharacterAdded After That
	Player.CharacterAdded:Connect(function(Character) -- CharacterAdded Gives Back The Character
		if Character then -- Check If Character Exists
			Reset()
		end
	end)
end)
3 Likes

Hmm, not sure if this helps. I need a function that I can call in the middle of the game, that resets the map (or everything under workspace) and runs every script from the beginning. Just like what happens when you first load up a server.

What If You Teleport Players Into Reserved Server?