bloberous
|
  |
| Joined: 07 Jun 2009 |
| Total Posts: 299 |
|
|
| 15 Jul 2016 12:35 AM |
What do people use when they want the script to do nothing? Do you just end it? Do you put return? Do I just not include it?
For example:
if hit.Parent.Name = bloberous then DO NOTHING? else hit.Parent:findFirstChild'Humanoid'.Health = 0 end
While I think I can do it this way, I still want to know how to tell the script to do nothing at that point.
if hit.Parent.Name ~= bloberous then hit.Parent:findFirstChild'Humanoid'.Health = 0 end |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:38 AM |
If hit.Parent.Name ~= "bloberous" then hit.Parent.Humanoid.Health = 0 End |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:40 AM |
| They don't write any code? |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:47 AM |
if hit.Parent.Name == bloberous then hit.Parent:findFirstChild'Humanoid'.Health = 100 else hit.Parent:findFirstChild'Humanoid'.Health = 0
this is how i'd do that. but i don't know how to make it do nothing. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:50 AM |
No, instead of doing that, you can do this.
if not hit.Parent.Name = bloberous then hit.Parent:findFirstChild'Humanoid'.Health = 0 end
But yes, you can do nothing. It won't break the script in any way, it's just not efficient and not recommended.
For functions, you can either do nothing or you can just do return, which in terms will end the function.
function Function() if hit.Parent.Name == bloberous then return else hit.Parent:findFirstChild'Humanoid'.Health = 0 end end
#code function brag() print("R$691") end |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:52 AM |
if not hit.Parent.Name or hit.Name = bloberous then hit.Parent:findFirstChild('Humanoid').Health = 0 else return end
|
|
|
| Report Abuse |
|
|
bloberous
|
  |
| Joined: 07 Jun 2009 |
| Total Posts: 299 |
|
|
| 15 Jul 2016 12:54 AM |
Yeah I just tried return and it works.
There's just something in my brain that goes "make it do nothing when this happens and do this when this happens" instead of "if this doesn't happen, do this". |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2016 12:56 AM |
Hey, we all prefer what we like. Glad you found something you like. :)
#code function brag() print("R$691") end |
|
|
| Report Abuse |
|
|