Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

CharacterAutoLoad Problem, Help?

Players.PlayerAdded:connect(function(plr)
plr:LoadCharacter()
end)

How would I make this Work? The Gui doesn't show up if there's no Character, how would I make the Gui show up no matter wat so that I can Load the Character???

4 comments

0

What Gui?

0

Which Gui are we talking about? Why doesn't this work? This should allow you to spawn once (on join) IF this code is running in a server script.

0

i made a Gui, u click on it, u cant see it and u Spawn...

0

if the Character hasn't loaded, there's no StarterGui or Backpack, so the Gui cant be Loaded :p I need help guys...

2 answers

You could just place a spawnlocation in the sky, or somewhere where the player wouldn't be seen, and then you could have a script teleport the character to a fake spawn on the ground. Like this:

--This script in the Gui button
local Player = game.Players.LocalPlayer
local Button = script.Parent
Button.MouseButton1Down:connect(function()
	repeat wait() until Player.Character:FindFirstChild("Torso")
	local Spawns = game.Workspace.Spawns:GetChildren()
	local RandomSpawn = Spawns[math.random(1,#Spawns)]
	Player.Character.Torso.CFrame = RandomSpawn.CFrame + Vector3.new(0,3.5,0)
end)

Make sure you have a model in the Workspace called "Spawns", and it has all the fake spawns that the player can teleport to

1 comment

0

dude... if i could, I'd do that millions of ages ago :p I don't want the Player to see his Character at all...

What you do for this is:

Let the player spawn normally, on a normal spawn with CharacterAutoLoads set to true

Place a part in workspace called "CameraPart" to show where you want the player's camera to be. The Front face of this part is the direction the camera will be facing. (Make sure it's anchored)

In a localscript:

Game.Players.PlayerAdded:connect(function(p)
	p.CharacterAdded:connect(function()
		local camera=Game.Workspace.CurrentCamera
		camera.CameraType=Enum.CameraType.Scriptable
		Camera.CoordinateFrame=Workspace.CameraPart.CFrame
	end)
end)

Please comment with any questions.

3 comments

0

wat about wen I Spawn?

0

u there??? it doesn't work...

0

please un-downvote now that I've answered you via PMs you sent me...

This discussion is preserved as it was. New answers, comments, and votes are closed.