I dont know what this script kinda doesand i kinda need help

ohhh probably yes, but can u explain what a tween service really does?

You need to get the player’s humanoid, load the animation for it using Humanoid:LoadAnimation() and use Humanoid.Died:Connect() to detect when they die. After they die, anchor their HumanoidRootPart, turn breakjointsondeath off and play the animation.

Adding onto Qariter, if you are playing these animations, you need to have made the animations first, with blender or the built in animation plugin.

1 Like

wait what will breakjointsondeath do if there s alredy an event that is the humanoid.Died:Connect() and why is this not being Connected t anything.

it literally “breaks” the rig and parts, which will also “kill” the character.

Oh, you just have to do Humanoid.BreakJointsOnDeath = false after you get the humanoid. My bad for the confusion!

If you’re new to scripting, I seriously recommend looking more on tutorials before tackling this.

Also, I meant make a function using Humanoid.Died!

1 Like

i dont know why i find sometimes tutorials kinda boring can u tell me a scripter that explains like a little better then some others

a youtuber i mean sorry about that

Said scripter is you. If you don’t have the courage to look at documentation, you’ll have a tougher time learning. You can also try looking at simple freemodel’s scripts, like a killbrick and such.

uhh other people already made a tutorial so you can look at that, or you can use youtube.

ohhh like api docs i once saw a video which said to like to look at the devhub and forms instaed of mindlessly looking at docs

oh my god let me spoon feed you with some code here

game:GetService("Players").PlayerAdded:Connect(function(plr)
       plr.CharacterAdded:Connect(function(char)
              local humanoid=char:WaitForChild("Humanoid")
              humanoid.Died:Connect(function()
                       --player died do something here
              end)
       end)
end)

i dont wanna just copy and past code tho i actually want to learn the code

alright lil bro

thats up to you if you want to copy paste or actually learn code

I wish you learn all the advanced scripting and become super bilionare with infinite robux :happy3:

thx tho for helping tho. hope u make a really good game one day too :grinning:

1 Like

To do that (in serverside script):

local Players = game:GetService("Players")
local Animation = script.Animation -- It should be animation object and you need to set id in it.

Players.PlayerAdded:Connect(function(player)
	local Character = player.Character or player.CharacterAdded:Wait()
	local Humanoid = Character:WaitForChild("Humanoid")
	
	Humanoid.Died:Connect(function() -- This function firing when player is died
		player.CharacterAdded:Wait() -- this waits until the character fully loaded
		-- in this section you can script anything after player is respawned. Example:
		local AnimationToPlay = Humanoid:LoadAnimation(Animation)
	    AnimationToPlay:Play()
	end)
end)

Here is for local script:

local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local Animation = script.Animation -- inside the script

Humanoid.Died:Connect(function()
	Player.CharacterAdded:Wait() -- this waits until the character fully loaded
	-- in this section you can script anything after player is respawned. Example:
	local AnimationToPlay = Humanoid:LoadAnimation(Animation)
	AnimationToPlay:Play()
end)

Those scripts i prepared for you is to play animation on character. You should add animation object inside the script and set the “AnimationId” property to the ID of your animation (you can get this from roblox website). Also, if there is anything you don’t understand, let me know(in script). Local scripts should be in starterplayerscripts,startercharacterscripts,startergui(maybe) etc. serverscripts can be created in everywhere

wait why do you need a local script too and how do you know like where to always put your scripts

i always since 11 always had trouble with that

Server sided scripts: run by the SERVER
Client sided scripts: run by your client only (or PC) with some exceptions.