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!
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
thx tho for helping tho. hope u make a really good game one day too
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.
so the client is the own player ohh i get it
Local scripts are for individual players. For example getting their inputs, keys that they pressed even for the phone etc. Serversidescripts are for all the server like countdown for a map or rarity systems etc. Also serversidescripts are shown for all players but local scripts not everytime.
ohhhh makes sense now thx , inputs are services right?
but and keys? do keys like store values?
I mean’t like pressing K key on your keyboard and detecting that.
ohhh i gotta learn that too i think i should and try to read almost all the api docs cuz tbh i am kinda bad so i am looking to improve