not entirely sure if there’s even a way to do this but is there a way to stop the character of the player from loading until needed or no?, i think some games use this, not sure though.
Is this what you are looking for?
https://developer.roblox.com/en-us/api-reference/property/Players/CharacterAutoLoads
from taking a look at it, it might be it although cant test it for a few more hours but once i can ill let you know if its it
(Edit)
Tried setting up some basic stuff using what this had
function AddGui(Player)
local gui = game.StarterGui.Main:Clone()
gui.Parent = Player.PlayerGui
end
function PlayerDied(Player)
wait(2)
Player.Character:Remove()
end
function AddedPlayer(Player)
AddGui(Player)
local Character = Player.CharacterAdded:Wait()
while wait() do
if Character.Humanoid.Health == 0 then
print("Died")
PlayerDied(Player)
break
end
end
end
Players.PlayerAdded:Connect(AddedPlayer)
But when i remove the character, the camera still gets stuck there and it seems to find the character still (Heres the server event)
game.ReplicatedStorage.Events.SpawnEvent.OnServerEvent:Connect(function(player)
if player.Character then print("Character Found") return end
player:LoadCharacter()
end)
You aren’t triggering any remote events in the client, so that won’t do anything.
Also, because you’re using CharacterAdded:Wait()
, that while loop will always be checking the player’s first character model, ignoring characters after spawning.
Also also, there is a Humanoid.Died event you can and should use
Look at the example at the bottom of the CharacterAutoLoads event. It seems very similar to what you want.
?? not entirely sure what this means
I tried player.Character but it errors so (Edit, probably could be better but used this)
if not Player.Character then repeat wait() until Player.Character end
local Character = Player.Character
I was orginally going to use this but when the character spawned it it would fire for no reason so idk
its what i was basing my code of off