Hey Roblox, you shouldent directly set the health to 0 but get a variable of the Humanoids MaxHealth, and current health, then get the difference between them, then use the humanoids TakeDamage() function with the difference between the 2 variables. This would ensure that if you have a forcefield you survive, and dosent take away extra damage. also add a debounce in the Touched event.
I thought that was the point To trick the player into think it is learning how to do one specific thing, but actually it’s something that could be applied for many situations
Textures for beams are in the toolbox, just search "beam texture". And the script is very easy, it is actually a default killbrick, so there's no strict requirements, but anyways local lasertrap = script.Parent local collisionBox = laserTrap.CollisionBox local function onTouch(otherPart) local character = otherPart.Parent local humanoid = character:FindFirstChildWhichIsA("Humanoid") If humanoid then humanoid.Health = 0 end end collisionBox.Touched:Connect(onTouch)
@@Kitoucher that's too complicated, I mean the script it should be easier like this newpart.Touched:Connect(function(touchpart) humanoid = touchpart.Parent:FindFirstChild("Humanoid") if humanoid then humanoid.Health -= 10 task.wait(1) end end)
@@JREHighLightings and :connect(function()) makes a new function, which is perfomance consuming, using already existing function is better than creating one every time script triggers.
I clicked on the "Generate Textures with AI" video in the creator hub and it directed me here for some reason.
yep same, but im not complaining im glad i got send to this video lol
Lol same
Yeah
lol
same
Fantastic Tutorial !! So well explained - no doubt left behind.
I look forward to other educational videos like this. THX.
Hey Roblox, you shouldent directly set the health to 0 but get a variable of the Humanoids MaxHealth, and current health, then get the difference between them, then use the humanoids TakeDamage() function with the difference between the 2 variables. This would ensure that if you have a forcefield you survive, and dosent take away extra damage. also add a debounce in the Touched event.
No debounce, kinda important for touched events.
this is literally a glorified kill brick
I was js thinking that
I thought that was the point
To trick the player into think it is learning how to do one specific thing, but actually it’s something that could be applied for many situations
Yay tutorials! 😁
2:54 my god you CAN say "Die" they say it a bit in some shows for older kids i think
Worked well! Wow... i learned my first code and actually learned it after 2 year of given up
"Texture file go BRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR" Epik moment.
good job
1:23 texture file go brrrrrrrrrrr
i ended up finding this while watching videos, to make it do a certain amount of damage make the kill script say
=- 5 and not = 0
use += if u want it to increase health and also *= if u want it to multiply health
i have a question, how i can use this on a gun?
but how would i get a texture ID? also WHERE IS THE FINISHED SCRIPT???????
Textures for beams are in the toolbox, just search "beam texture".
And the script is very easy, it is actually a default killbrick, so there's no strict requirements, but anyways
local lasertrap = script.Parent
local collisionBox = laserTrap.CollisionBox
local function onTouch(otherPart)
local character = otherPart.Parent
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
If humanoid then
humanoid.Health = 0
end
end
collisionBox.Touched:Connect(onTouch)
@@Kitoucher that's too complicated, I mean the script it should be easier like this
newpart.Touched:Connect(function(touchpart)
humanoid = touchpart.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health -= 10
task.wait(1)
end
end)
I added the wait by accident since it was from a previous script
@@JREHighLightings it's not my script, as he asked, i sent him a script from the video.
@@JREHighLightings and :connect(function()) makes a new function, which is perfomance consuming, using already existing function is better than creating one every time script triggers.
the problem is that i cant search for some reason
Wow
didn't work at all. it didn't let me make the beams work and didn't kill me
thank you
thank you john roblox
Does This Help Me?
i tought you were eplaining how to script and control the beam
collisionbox
this gave me a minecraft ad bruh
How Damage players, u already teach how make a hitkill-touchblock
this is not a collision box this is called a hitbox
practically the same thing
@@abidbmtt not rally, collision boxes can be just for collisions. Hit boxes are for damage.
@@Tact1kalnope. They're the same thing.
this helped me alot!, thanks roblox for making theese tutorials
Thanks David
Aptundu - Aptundu - Famaus Roblox Song
para traducirlo del ingles, ¿?
Make it for cell phone
thanks this tutorial is so good!
thx but i dont get it
do u need help? i can help u get better at scripting, and btw this is basically a killbrick
no id thing is in the descriptioin
cool
How do you make on mobile?
u need pc, mobile doesn't have roblox studio
@@edvilemon5039 :(
bad news, its only on pc. i wish is on mobile tho ):
@@aaaaaaaaaiguess I don't think it's possible for an entire game making engine to get squished into mobile
Can you make it so you can create on ps4
local functon 👀☠
*function
Thnk You!
No thing Happened i dont Know why
okay
epic!
This tip was very Helpful!!!
it works ty roblox
I’m gonna make my own game!
it doesnt work :(
What exactly doesn't work?
Muito legal
texture file go brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
good
Long how 😢Thy or Left1120😊
a better way to do this is to use raycast
Not really, raycasts would lag the server if theres lots of them
Quiero desarrollar un juego de parkour y que lleve un item de como primer juego que hago
what is this!!!
Oh
oh my yap
Hi
hi
It work
4:02
wyyyyyyy my vres
Πολύ😎
primero en español :D
Quem e do brasil deixa seu like
Wow