Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make the player's body parts turn transparent when killed?

Asked by 5 years ago
 Game.Workspace = game.Players.LocalPlayer humanoid.game.health -100 then
    while true do
    local player. "Head" = Transperancy = 1
    local player. "Right Arm" = Transperancy = 1
    local player. "Torso" = Transperancy = 1
    local player. "Left Leg" = Transperancy = 1
    local player. "Left Arm" = Transperancy = 1
    local player. "Right Leg" = Transperancy = 1
end

0
While im not going to make a script, i will say that literally everything here is wrong. You even spelled transparency wrong. Please try this again. DinozCreates 1070 — 5y
0
lol TheluaBanana 946 — 5y

2 answers

Log in to vote
0
Answered by
HaveASip 494 Moderation Voter
5 years ago
Edited 5 years ago

Dude, all your script wrong and I have to code new script myself. Insert a script inside ServerScriptService and type in this

game.Players.PlayerAdded:Connect(function(player)
    local char = player.Character or player.CharacterAdded:Wait() --gets player's character
    game.Workspace.ChildAdded:Connect(function(object) --starts when some child added to workspace
        if object:FindFirstChild("Humanoid") then --checks if that child is player's character
            local Humanoid = char:WaitForChild("Humanoid") --gets player's character humanoid
            Humanoid.Died:Connect(function()  --starts when player died
                for _,v in pairs(char:GetChildren()) do --checking all the parts inside of character
                    if v:IsA("BasePart") or v:IsA("Part") then --checking if part is a basepart or part
                        v.Transparency = 1 --set transparency to 1
                    end
                end
            end)
        end
    end)
end)    

0
yo hoold up TheluaBanana 946 — 5y
0
ok im just gonna include dis anyway ik dis has been answered. TheluaBanana 946 — 5y
0
??? HaveASip 494 — 5y
0
What do you mean? HaveASip 494 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

this is how mainstream devs(most) do it, ik its answered and u dont need to do anything but i just hope u see this, same place as HaveASip said

workspace.ChildAdded:connect(function(child)
    local hum = child:FindFirstChild("Humanoid")
    if hum then
        hum.Died:connect(function()
            for i, v in pairs(child:GetChildren()) do
                if v:IsA("Part") or v:IsA("BasePart") then
                    v:Destroy()
                end
            end
        end)
    end
end)
0
why do you posted same script? HaveASip 494 — 5y
0
its not the same its altered a bit and it destroys insteand of turning parts invisible that way its more effective TheluaBanana 946 — 5y
0
instead* TheluaBanana 946 — 5y
0
lol HaveASip 494 — 5y
View all comments (4 more)
0
-- Added one line -- more effective HaveASip 494 — 5y
0
He wanted to change transparency(not to delete the parts inside of character) HaveASip 494 — 5y
0
im aware, just wanted to point this out TheluaBanana 946 — 5y
0
not everything needs to be on point, im also not saying that this is better or anything TheluaBanana 946 — 5y

Answer this question