Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What could I do to make the script say something other than "nil"?

Asked by 10 years ago
brick=script.Parent

brick.Touched:connect(function(hit)
--Function Here
print("touched")    
end)

i did just as the tutorial said...but it says "nil"

Oh and what does "nil" mean?

1 answer

Log in to vote
2
Answered by 10 years ago

Hi snoppy!

Let's first start with the question "What does nil mean?"

ROBLOX Says: nil is a state of non-existence or nothingness

Basically, nil = nothing. Whenever you see nil, it means nowhere, nothing, or not there.

Now, as for your script, everything seems correct at first glance, however try renaming the Part it is in to something like "PartTouch" and try this on line 3:

game.Workspace["New Part name here"].Touched:connect(function(hit) 

What it does:

game.Workspace["New Part name here"] simply indexes the part in one line, and the rest is the same.

0
You did really good explaining that! thx :D snoppyploptart 59 — 10y
Ad

Answer this question