Hi Developer
So I have a problem, I’m on making Killbrick but I think this script is correct, and there are no problems in the Analysis Script
here the photo
Hi Developer
So I have a problem, I’m on making Killbrick but I think this script is correct, and there are no problems in the Analysis Script
here the photo
change humanoid.Health = 0
to humanoid:TakeDamage(humanoid.MaxHealth)
see if it works
buddy try using the collection service event, maybe the parts just didnt get added when u checked for all tags
it Doesn’t work to. I’ve followed your suggestion
I don’t really know what you mean, but I follow this guy https://youtu.be/80z3Xg8Sy_g?si=nT1RXT3JCQHIOQfu
can you print part
in line 15
change part.Touched:Connect(onPartTouched)
to
part.Touched:Connect(function(hit)
onPartTouched(hit)
end)
There is no use is using a function to loop through items that will be used only once. Remove it. Also it could also be because you maybe did not tag them.
Another thing you could do is instead of using tags and CollectionService
, is put all the kill bricks into a folder and insert a script. Name it KillBrickHandler.
The hierarchy should look like this:
Insert this code into your script:
local folder = script.Parent
for _, part in pairs(folder:GetChildren()) do
if part:IsA("Part") then
part.Touched:Connect(function(otherPart)
local Character = otherPart.Parent
local Humanoid = Character:FindFirstChild("Humanoid")
if Humanoid then
Humanoid:TakeDamage(Humanoid.MaxHealth)
end
end)
end
end
Let me know if there are any bugs or something doesn’t work. Hope this helps!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.