Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why do I have this LoadCharacter() problem?

Asked by
Supint 60
10 years ago

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.

01local Players = game:GetService("Players")
02Players.CharacterAutoLoads = false
03 
04game.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")
09        if Humanoid then
10            Humanoid.Died:connect(function()
11                wait(1)
12                Player:LoadCharacter(false)
13                Player.PlayerGui.Shop.Base.Visible = true
14                print("this")
15            end)
View all 21 lines...

Answer this question