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.
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.
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âŚ
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
It should have no checkmark beside âResetOnSpawnâ.
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)
Oh no worries. I am glad you are able to help.