You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
I’m attempting to have this script set the players clothing after they died, so I’m trying to wait for their character to load first, then set the clothing. -
What is the issue?
The script just stops at the .CharacterAdded:Wait() nothing after that will fire. -
What solutions have you tried so far?
I’ve tried moving the script to StarterGui, and looking at similar problems, but to no avail. I’ve tried different things like .CharacterAppearanceLoaded
Extra Details:
The script is a LocalScript
The script is currently in StarterCharacterScripts.
player = game.Players.LocalPlayer
function setvar()
department = player.Team
print(department.Name)
end
function setclothingondeath()
wait(0.5)
print("funcstarted")
if department then
player.CharacterAdded:Wait()
print("depatmentfound")
game.ReplicatedStorage.Events.CharacterDepartmentChangeServer:FireServer(department)
end
end
player.Character:WaitForChild("Humanoid").Died:Connect(setclothingondeath)
game.ReplicatedStorage.Events.CharacterOutfitFinalClient.Event:Connect(setvar)