wow… im impressed man
didnt expect that
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
character:WaitForChildd("UpperTorso"):Destroy()
end)
end)
this should work then, but if youre going to use r6 characters u gotta change the UpperTorso to Torso
This is honestly the weirdest problem I have ever encountered in the 10+ years I’ve been developing on Roblox. I can still walk around normally.
Looks like your character is just immortal.
idk maybe try this xd
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
for i,v in pairs(character:GetChildren()) do
if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
v:Destroy()
end
end
end)
end)
Got an error in the console:
14:59:07.582 - Model:GetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.
14:59:07.583 - A primary part should be set so that the character can be spawned correctly
Also, the camera subject was changed so I know this is not viable.
this is driving me mad
try this
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
plr:WaitForChild("Humanoid"):Destroy()
end)
end)
Still nothing. Does not do anything.
why would u spawn kill a character anyways
What about trying character:BreakJoints()
if character is the player model in Workspace.
I don’t know why you people trying some bizarre things when :TakeDamage()
exist:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid:TakeDamage(humanoid.MaxHealth+100)
end
end)
end)
This still does not work. Gives the same result as before, meaning the health bar drops down to 0 and the player is somehow still alive.
Possibly you’re unable to kill the player in the same frame it’s created, try using
wait(game:GetService("RunService").Heartbeat)
this should kill the player almost at the same time the player spawns.
ok man just do this then
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
repeat
character:WaitForChild("Humanoid").Health -= 50
until character:WaitForChild("Humanoid").Health < 0
end)
end)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
character:BreakJoints()
end)
end)
What are you putting this in? A Local script or server script?
You made me check for the parent, and the parent seems to be “nil”, but I used this to check when the parent is changed to “Workspace” and then I set the Health to 0, and it STILL didn’t work:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid.Parent.AncestryChanged:Connect(function(_, parent)
print(parent)
if parent == game.Workspace then
humanoid.Health = 0
end
end)
end
end)
end)
Parent prints “Workspace” but it still does nothing. I also tried :BreakJoints() but it did nothing.
You may be right but would you be willing to explain why I need to wait a frame for this to happen? I’d rather not use any waits.
I’m no professional but I would assume that’s engine limitations or just hard coded in order to prevent something from happening, same thing with trying to use :Destroy() on the same frame an instance is created
This makes a lot of sense actually if I think about it now. Thank you for explaining this. Since the health is 0 when instanced, it does not activate the listeners until the next frame.
I will mark that as the solution.