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
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