Click play to end cutscene and spawn in

It still does the same thing as the other scripts.

Are you sure about that? For me it works perfectly fine… The character just doesn’t get unloaded or loaded in at first but the fix is in this server script…

ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Event = ReplicatedStorage:FindFirstChild("spawnPlayer")
if not Event then
	local newEvent = Instance.new("RemoteEvent")
	newEvent.Name = "spawnPlayer"
	newEvent.Parent = ReplicatedStorage
	Event = newEvent
end

Event.OnServerEvent:Connect(function(Player)
	if Player:GetAttribute("loadedMenu") == false then
		Player:SetAttribute("loadedMenu", true)
		Player.Character.Parent = game.Workspace
	end
end)

Players.PlayerAdded:Connect(function(Player)  --
	Player:SetAttribute("loadedMenu", false)
	task.wait(2)
	local Character = Player.Character or Player.CharacterAdded:Wait()
    Character.Archivable = true
	for i,v in pairs(game.Workspace:GetDescendants()) do
		if v:IsA("SpawnLocation") then
			Character:MoveTo(v.Position)
			break
		end
	end
	Player.CharacterAdded:Connect(function(Char)
        Char.Archivable = true
		if Player:GetAttribute("loadedMenu") == false then
			for i,v in pairs(game.Workspace:GetDescendants()) do
				if v:IsA("SpawnLocation") then
					Char:MoveTo(v.Position)
					break
				end
			end
			Char.Parent = ReplicatedStorage
		end
	end)
end)

Nope, I get put right back to the cutscene. Let me get a video.

robloxapp-20220511-1752374.wmv (2.9 MB)

Were there any errors inside of the output?

Did you make sure to update the server script to the one I just posted?

Edit: Also change the PlayButtonGUI property ResetOnSpawn to false (only if you don’t want the menu to appear every time your character dies.

1 Like

Could it be the other script I made a while back causing this?

I just tested it and I spawned in but after like 5 seconds it went back to the cutscene.

Yep, it definitely is, if that script is still enabled. I also just edited my last post, make sure to read it.

Where would I change this in the script?

Wait so I delete my cameras script?

Oh, wait… I made another mistake in the server script.

Change the server script to this…

ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Event = ReplicatedStorage:FindFirstChild("spawnPlayer")
if not Event then
	local newEvent = Instance.new("RemoteEvent")
	newEvent.Name = "spawnPlayer"
	newEvent.Parent = ReplicatedStorage
	Event = newEvent
end

Event.OnServerEvent:Connect(function(Player)
	if Player:GetAttribute("loadedMenu") == false then
		Player:SetAttribute("loadedMenu", true)
		Player.Character.Parent = game.Workspace
	end
end)

Players.PlayerAdded:Connect(function(Player) 
	Player:SetAttribute("loadedMenu", false)
	task.wait(2)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	Character.Archivable = true
	for i,v in pairs(game.Workspace:GetDescendants()) do
		if v:IsA("SpawnLocation") then
			Character:MoveTo(v.Position)
			break
		end
	end
	Character.Parent = ReplicatedStorage
	Player.CharacterAdded:Connect(function(Char)
		Char.Archivable = true
		if Player:GetAttribute("loadedMenu") == false then
			for i,v in pairs(game.Workspace:GetDescendants()) do
				if v:IsA("SpawnLocation") then
					Char:MoveTo(v.Position)
					break
				end
			end
			Char.Parent = ReplicatedStorage
		end
	end)
end)

You can delete or disable it. It’s your choice. If you’re disabling, it should look like this…
image

Make sure to edit the server script to the one I sent on my last post.

Also, after doing this, if you’re having the same issue, try doing this to the PlayButtonGUI…

Image

image
It should have no checkmark beside “ResetOnSpawn”.

1 Like

But when I click play it works. Only thing now is I spawn before clicking play.

EDIT I fixed it but am I able to fix the blue on the top of the flash?

EDIT Nevermind again I still spawn before hitting play

Alright, sorry for making you do so many things. I should’ve tested everything before immediately sending the script. Anyways, I’ve just tested this now and everything will work as intended.

ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Event = ReplicatedStorage:FindFirstChild("spawnPlayer")
local PlayersFolder = ReplicatedStorage:WaitForChild("Players")
if not Event then
	local newEvent = Instance.new("RemoteEvent")
	newEvent.Name = "spawnPlayer"
	newEvent.Parent = ReplicatedStorage
	Event = newEvent
end
if not PlayersFolder then
	PlayersFolder = Instance.new("Folder")
	PlayersFolder.Name = "Players"
	PlayersFolder.Parent = ReplicatedStorage
end

Event.OnServerEvent:Connect(function(Player)
	if Player:GetAttribute("loadedMenu") == false then
		Player:SetAttribute("loadedMenu", true)
		Player.Character.Parent = game.Workspace
		for i,v in pairs(game.Workspace:GetDescendants()) do
			if v:IsA("SpawnLocation") then
				Player.Character:MoveTo(v.Position)
				break
			end
		end
	end
end)

Players.PlayerAdded:Connect(function(Player) 
	Player:SetAttribute("loadedMenu", false)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	Character.Archivable = true
	for i,v in pairs(game.Workspace:GetDescendants()) do
		if v:IsA("SpawnLocation") then
			Character:MoveTo(v.Position)
			break
		end
	end
	task.wait()
	Character.Parent = PlayersFolder
	Player.CharacterAdded:Connect(function(Char)
		Char.Archivable = true
		if Player:GetAttribute("loadedMenu") == false then
			for i,v in pairs(game.Workspace:GetDescendants()) do
				if v:IsA("SpawnLocation") then
					Char:MoveTo(v.Position)
					break
				end
			end
			task.wait()
			Char.Parent = PlayersFolder
		end
	end)
end)
1 Like

Oh no worries. I am glad you are able to help. :slight_smile:

I still spawn

1 Like