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

how do i turn this into a killbrick?

Asked by 4 years ago

basically the result i'm looking for is that the spawned car can kill the player when it gets touched

while true do
wait(20)
local car = Instance.new("Part", workspace)
local mesh = Instance.new("SpecialMesh", car)
mesh.MeshId = "rbxassetid://1490852609"
mesh.TextureId = "rbxassetid://1490852626"
mesh.Scale = Vector3.new(1.3,1.3,1.3)
car.Position = script.Parent.Position
car.Name = "car"
car.Anchored = false
car.Size = Vector3.new(9,6,20)
car.Velocity = Vector3.new(0,0,-150)
car.Material = Enum.Material.Ice
wait(4.5)
car:Destroy()
end
0
Is the kill ment for the owner of the car or for everyone FluffySheep46209 369 — 4y

1 answer

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

Hi. This should work:

while true do
wait(20)
local car = Instance.new("Part", workspace)
local mesh = Instance.new("SpecialMesh", car)
mesh.MeshId = "rbxassetid://1490852609"
mesh.TextureId = "rbxassetid://1490852626"
mesh.Scale = Vector3.new(1.3,1.3,1.3)
--car.Position = script.Parent.Position -- this is not going to work
car.Name = "car"
car.Anchored = false
car.Size = Vector3.new(9,6,20)
car.Velocity = Vector3.new(0,0,-150)
car.Material = Enum.Material.Ice
car.Touched:Connect(function(hit)
     if game.Players:FindFirstChild(hit.Parent.Name) then
     hit.Parent.Humanoid.Health = 0
end
end)
wait(4.5)
car:Destroy()
end
0
yes greendayshade 5 — 4y
0
post comments in comments pls MuffinZMan_YT 20 — 4y
0
oops sorry Yukogan 72 — 4y
0
I edited it. Yukogan 72 — 4y
View all comments (2 more)
0
it works, thanks. greendayshade 5 — 4y
0
No problem! Yukogan 72 — 4y
Ad

Answer this question