Still damages things but it doesn’t work.
if humanoid and humanoid.Health ~= 0 then
Do you have the 0 instead of “nil”? Because I made a small mistake and maybe you copied it wrong.
Yeah but that doesn’t change the fact that it doesn’t damage it.
I have the solution! The Humanoid Must be inside a model. Put the Part and the Humanoid in the same model.
Hope this works, I am not 100% sure.
Would the humanoid be inside the part still or would it be just inside the model?
Inside the model, if this doesn’t work I will try to remake the scripts.
It works now! Thank you so much!
No problem! I am glad it worked! Make sure you make that answer the solution.
Also, is there a way to make that a bar? Like instead of using text you can make it like a progress bar but it goes down.
You could insert a progress bar, insert a script inside it. And in the script you divide the health by maxHealth and round it up.
I’ve never used it so I do not understand a word about what you’re saying.
First, you create a progress bar. Then you do some math:
local frame = script.Parent
local bricc = workspace.brickgod
local human = bricc.Humanoid
while true do
frame.Size = UDim2.new(math.floor((bricc.Humanoid.Health) / (bricc.Humanoid.MaxHealth)),0,1,0)
end
That would be a health bar basically, YT is full of tutorials but I can show you a small script here.
A useful tutorial.
local HPBar = script.Parent.Parent:FindFirstChild("HPBarName")
local Brick = workspace:FindFirstChild("brickgod")
local Human = Brick:FindFirstChild("Humanoid")
Human.HealthChanged:Connect(function()
local Percent = Human.Health / Human.MaxHealth * HPBar.Size.X.Offset
HPBar.Size = Udim2.new(0, Percent, 0, HPBar.Size.Y.Offset)
end)
You will have to make your own HealthBar Frame
Your while true do loop would break someone’s studio, remember to add a wait() !
It automatically disabled it after the max executions if you don’t add wait()
Oh well, I forgot about that fact. But you get what I was saying.
That tutorial is for a player type one so I don’t think I’ll bother with it because I don’t know to to change it.
Is there is a localscript? Inside the GUI?
It’s all solved like an hour ago…