What is the issue with the spawning?
Iām really confused on how your character is not spawning for youā¦ it actually works fine for me and doesnāt spawn my character until I click play, but Iām not sure why itās not working for you.
EDITED ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Event = ReplicatedStorage:FindFirstChild("spawnPlayer")
local PlayersFolder = ReplicatedStorage:FindFirstChild("PlayersFolder")
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 = "PlayersFolder"
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)
I am spawning it but I spawn in before I click play.
EDIT
I tested the serverscript you sent and I still spawned in before.
I just realized the mistake I madeā¦ Just go back to my last post and re-copy the script. It will definitely work!
Hmmā¦ Iām still very confused why it isnāt working!!!
Iām talking about the post I just edited. I edited the script there and I told to re-copy.
Iāll just repost the script in hereā¦
ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Event = ReplicatedStorage:FindFirstChild("spawnPlayer")
local PlayersFolder = ReplicatedStorage:FindFirstChild("PlayersFolder")
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 = "PlayersFolder"
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)
Sorry, I was eating dinner. Let me test this.
I am still spawning in before I click play.
Do you have a script that spawns the player in other than the ones I gave you?
No, I donāt think so. Is there something in properties I should change?
All I need now is something that keeps the player from spawning until the player clicks play.
Hmm, so the script didnt worked?
If no then can make the well explained script and give you it? (ill start tonight tho when i wake up lul)
It does work but I made a new post on what needs fixed: Players Can't spawn until Clicking Play - #7 by 1PixeI1
I donāt spawn before now, but when I click play my character is invisible and I am unable to move.
ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Event = ReplicatedStorage:FindFirstChild("spawnPlayer")
local PlayersFolder = ReplicatedStorage:FindFirstChild("PlayersFolder")
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 = "PlayersFolder"
PlayersFolder.Parent = ReplicatedStorage
end
Event.OnServerEvent:Connect(function(Player)
if Player:GetAttribute("loadedMenu") == false then
Player:SetAttribute("loadedMenu", true)
Player.Character.Archivable = 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)
I still spawn invisible. Is there an actual way for this to work?
I still spawn invisible. Is there an actual way for this to work??