Why do I have this LoadCharacter() problem?
The script's purpose is to control the visibility of different GUIs corresponding to the life and death of the humanoid. It is also supposed to control the humanoid respawn, but for some reason I can't use LoadCharacter() when FE is enabled?
Filtering Enabled is on, and this is in a Server Script.
01 | local Players = game:GetService( "Players" ) |
02 | Players.CharacterAutoLoads = false |
04 | game.Players.PlayerAdded:connect( function (Player) |
05 | local gui = game.ReplicatedStorage.BeginGui:Clone() |
06 | gui.Parent = Player.PlayerGui |
07 | Player.CharacterAdded:connect( function (Character) |
08 | local Humanoid = Character:FindFirstChild( "Humanoid" ) |
10 | Humanoid.Died:connect( function () |
12 | Player:LoadCharacter( false ) |
13 | Player.PlayerGui.Shop.Base.Visible = true |
18 | Player:LoadCharacter( false ) |
19 | Player.PlayerGui:WaitForChild( "Shop" ) |
20 | Player.PlayerGui.Shop.Base.Visible = false |