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

How to make kill brick work while character is sitting?

Asked by 4 years ago

I'm making a camping game and when they sit in the car and go through the teleport part, there is no error saying cant teleport in studio. I tried making a kill part so that when they touch it they die and then they will be collidable so they will be teleported but they dont die when they touch the kill brick. How do I fix this?

heres the code for the kill brick

script.Parent.Touched:Connect(function(hit)
    if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Humanoid.Health = 0
    end
end)
0
Try Humanoid:TakeDamage(100) MrTrayLot 2 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Well, you could probably accomplish this by going in if Humanoid.Sit == true, this might work.

So do this.

if hit.Parent.Humanoid.Sit == true then
    -- Insert some code here.
end

Or something of the similar. You may mess around with the statement a bit but should be on the right track to help you.'

Some other methods could be to disable to seat brick as well.

Ad
Log in to vote
0
Answered by 4 years ago

try something like

Humanoid:TakeDamage(100)

Answer this question