Scripting problem

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    to solve this script

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    no I tried to fix this script by the help of the YouTube
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- game.Players.CharacterAutoLoads = false

game.Players.PlayerAdded:Connect(function(player)
	local introGui = game.ServerStorage:WaitForChild("IntroGui")
	local introGuiClone = introGui:Clone()
	introGuiClone.Parent = player.PlayerGui
	layer.CharacterAdded:Connect(function(character)
		local humanoid = character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			humanoid.Died:Connect(function()
				wait(5)
				player:LoadCharacter()
			end)
		end
	end)
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

-- game.Players.CharacterAutoLoads = false

game.Players.PlayerAdded:Connect(function(player)
	local introGui = game.ServerStorage:WaitForChild("IntroGui")
	local introGuiClone = introGui:Clone()
	introGuiClone.Parent = player.PlayerGui
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			humanoid.Died:Connect(function()
				wait(5)
				player:LoadCharacter()
			end)
		end
	end)
end)

there is nothing in the image except ur name

Did you remove IntroGui from the game? causing the script to break? If yes it can be solved by removing the lines below:

local introGui = game.ServerStorage:WaitForChild("IntroGui")
local introGuiClone = introGui:Clone()
introGuiClone.Parent = player.PlayerGui

Also it may be because the characters load before the .CharacterAdded event fires. In that case the script must assume the character may have already loaded:

game.Players.PlayerAdded:Connect(function(player)
	--player added code
	local function CharacterAdded(char)
		--character added code 
	end
	CharacterAdded(player.Character or player.CharacterAdded:Wait())
	player.CharacterAdded:Connect(CharacterAdded)
end)
1 Like

You need to provide more information if you want help with your problem. What is the script supposed to do? What’s going wrong? Are there errors that appear in the output?

The only thing that seems to be off with the code you’ve provided is a typo on line 7

-- "layer" instead of "player"
	layer.CharacterAdded:Connect(function(character)