Hello, So I got two scripts the first one makes it when the player touches a part play a animation.
The second one makes it that when they touch a part they die.
My problem is when they touch the part the don’t die I think its because in the first script it changes the name of the players humanoid but I need this to happen because if I didn’t change the name when the player touches the part it would always play the animation.
here are my scripts.
fisrt:
function onTouched(hit)
local human = hit.Parent:findFirstChild(“Humanoid”)
if human then
human.Name = “Glitch”
human.Parent.Head.face.Texture = “http://www.roblox.com/asset/?id=”
script.Parent.Parent.Part.Shutter:Play()
local anim = human:LoadAnimation(script.Parent.Animation)
anim:Play()
human.WalkSpeed = 0
wait(3)
human.WalkSpeed = 16
end
end
script.Parent.Touched:connect(onTouched)
Second:
–Variables–
local Brick = script.Parent
–End–
–Script–
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
if Parent.Humanoid.Name == “Glitch” then
Parent.Glitch.Health = 0
else
Parent.Humanoid.Health = 0
end
end
end
Brick.Touched:connect(PlayerTouched)
I just need it that when the player touches the kill part and the name of there humanoid is called glitch it still will damage them.