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

What does "Expected identifier, got _" mean?

Asked by 8 years ago

Self-explanatory question. I keep finding it whenever I try to make a function. What does it mean?

0
Can you please provide the code? Goulstem 8144 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

The reason you received the "got _", is because you typed the wrong symbol, in most case. an example is

f = Instance.new("Part",game.Workspace)
f.Anchored = true
f.Position = Vector3.new(1,1,1)
f_Remove()--- as we see here we got _ yet, it should be  f:Remove()

As we see here, this is a way to create a function.

--Creating a function
--unlike many programming languages which requires to call the function, rblx.lua oddly does not, or at 
----least not seen.
function name(anything)
for i, 1,2 do
print("hello world")
end
print("hello world prints twice")
 -- this is the basic feature of functions in roblox
0
Call the function, as in? Marios2 360 — 8y
Ad

Answer this question