I have a problem about character respawn. I have an experience including some power-ups like; bomb, fire etc.
It doesn’t happen every time but; sometimes after the bomb explosion, character respawns invisible on the server side. (Client side is normal)
I don’t use any custom characters or any custom respawn technique. I’ve tried so far; default Roblox respawn and Player:LoadCharacter(), but bug persists.
It’s a tweened size of a sphere part (like an explosion range).
Code is;
function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Humanoid.Health == 0 or hit.Parent:FindFirstChild("ForceField") ~= nil then return end
hit.Parent.Humanoid.Health = 0
end
end
script.Parent.Touched:connect(onTouched)
local PService = game:GetService("Players")
local KillRemote = game:GetService("ReplicatedStorage"):WaitForChild("KillPlayer")
function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Humanoid.Health == 0 or hit.Parent:FindFirstChild("ForceField") ~= nil then return end
local Player = PService:GetPlayerFromCharacter(hit.Parent)
KillRemote:FireClient(Player)
end
end
script.Parent.Touched:Connect(onTouched) -- using ':connect' is deprecated, use :Connect instead
Client Script:
local Player = game:GetService("Players").LocalPlayer
local character = player.Character
if not character or not character.Parent then
character = player.CharacterAdded:wait()
end
local KillRemote = game:GetService("ReplicatedStorage"):WaitForChild("KillPlayer")
KillRemote.OnClientEvent:Connect(function()
local H = character:FindFirstChildWhichIsA("Humanoid")
H.Health = 0
end)
Have you tried checking the scripts that handle checking if the Character has been added (e.g scripts that put a billboard gui or something like that)? There might be a rare error in one of them which breaks the Character loading in.
I checked them before this message and I realised it’s triggering itself more than once. I fixed it now, I need to try that for a long term again. Then I’ll mark your message as solution. Thanks!
If I were you then I’d try double checking the character scripts once again, or any script at all which edits the character at all, if not that then I don’t know what to say.
I doubt that this is a Roblox issue as this isn’t happening in any other game.
Maybe try DMing me on Discord and I’ll try helping as much as I can there, as talking on the forums can take hours for responses and has many limitations;
If I were you then I’d host maybe an event with some developer friends that you trust where the server is full or nearly full and you all just kill each other until the invisible thing happens. Then you tell them to check their consoles and then the answer will be there.
We tested it with more people and with the bomb power up. Then someone went invisible but no server side or client side error printed. Then we realised it’s happening because of the character is not fully reseted after losing some limbs. It’s happening far side of the bomb’s radius. So I think I can fix that after this information. Thanks for helping! (I’m marking your message as solution)