ipodman50
|
  |
| Joined: 24 May 2010 |
| Total Posts: 43 |
|
| |
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 28 Sep 2015 05:32 PM |
| Nil doesn't really have an opposite that I'm aware of. The closest analogy saying the opposite of "nothing" is "something", but that mean a lot of things. |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
| |
|
|
| 28 Sep 2015 05:33 PM |
not nil
DermonDarble is angry |
|
|
| Report Abuse |
|
|
ipodman50
|
  |
| Joined: 24 May 2010 |
| Total Posts: 43 |
|
|
| 28 Sep 2015 05:34 PM |
I'm trying to make a script so it doesn't spa function Points(hit) local FINALLY = hit.Parent:FindFirstChild("Humanoid").Value if (FINALLY ~= ???) then Instance.new("StringValue", FINALLY) end end
script.Parent.Touched:connect(Points)m a value into the player. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 05:36 PM |
if finally ~= nil then
DermonDarble is adorable |
|
|
| Report Abuse |
|
|
ipodman50
|
  |
| Joined: 24 May 2010 |
| Total Posts: 43 |
|
|
| 28 Sep 2015 05:37 PM |
| Then if someone keeps touching it, it will spam inside the players model. I want it so if it says oh it doesn't have this certain object I want it to insert the object in. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 05:37 PM |
though it would be better to do
``` if finally then --code end ```
DermonDarble is baking |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 28 Sep 2015 05:38 PM |
local FINALLY = hit.Parent:FindFirstChild("Humanoid").Value if not FINALLY then Instance.new("StringValue", hit.Parent:FindFirstChild("Humanoid")) end |
|
|
| Report Abuse |
|
|
Stymi
|
  |
| Joined: 19 Sep 2015 |
| Total Posts: 1077 |
|
|
| 28 Sep 2015 05:41 PM |
Argelius, you are doing what I call FindFirstChild abuse. Please read this:
"Q: Why do I get an error when I'm using FindFirstChild?
A: I like to refer to this term as "FindFirstChild abuse", and it's a really common problem. The thing is, most people don't notice it because whatever you're looking for will usually exist in some cases, but if it doesn't, this could lead to game breaking bugs.
Now, this is what I'm talking about. if workspace:FindFirstChild("TeamBrick").TeamValue.Value == "Blue" then --code end
That's actually very wrong. If you "keep going" after FindFirstChild, you are assuming that is true. It's like you didn't use FindFirstChild in the first place! Here's how to do it properly:
local teamBrick = workspace:FindFirstChild("TeamBrick") if teamBrick then -- checking if teamBrick is true. if teamBrick.TeamValue.Value == "Blue" then -- code end end"
Now this looks like a job for me. So everybody, just follow me. Cause we need a little, controversy. Cause it feels so empty without me. |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
| |
|
Stymi
|
  |
| Joined: 19 Sep 2015 |
| Total Posts: 1077 |
|
|
| 28 Sep 2015 05:43 PM |
And in the Instance.new() call, that's not how you use FindFirstChild either same thing.
Now this looks like a job for me. So everybody, just follow me. Cause we need a little, controversy. Cause it feels so empty without me. |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 28 Sep 2015 05:47 PM |
OP, what Sty is saying is that you should do this:
if hit.Parent:FindFirstChild("Humanoid") then local FINALLY = hit.Parent.Humanoid.Value if not FINALLY then Instance.new("StringValue", hit.Parent.Humanoid) end end |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 05:49 PM |
local nilornot = 0
if nilornot =< 0 then if nil then nilornot = 1 else if not nil then nilornot = 0 end end nilornot = 0 end
|
|
|
| Report Abuse |
|
|
ipodman50
|
  |
| Joined: 24 May 2010 |
| Total Posts: 43 |
|
| |
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
| |
|
|
| 28 Sep 2015 05:52 PM |
| http://wiki.roblox.com/index.php?title=Metatable |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 28 Sep 2015 05:54 PM |
| We don't need metatables; are you trolling |
|
|
| Report Abuse |
|
|