ROBLOX Lua error in script: '=' expected around '<eof>'
Hello I am writing scipt on ROBLOX and I am facing a problem.
function showVictoryMessage(playerName)
local message = Instance.new("Message")
message.Text = playerName .." has won!"
message.Parent = game.Workspace
wait (2)
message.Destroy()
end
After running this function, or more specifically the "message.Destroy" command, I get an error: Error in script: '=' expected near <eof> '
I've never seen this error before, and the Wiki page on ROBLOX on Lua Errors does not mention it.
I would really like to help with this, because I personally don't know anyone who is coded in Lua.
source to share
It looks like a syntax error. message.Destroy()
should be message:Destroy()
according to this Roblox wiki page http://wiki.roblox.com/index.php?title=API:Class/Instance/Destroy
Also see the Explosions, Messages, and More section at http://wiki.roblox.com/index.php?title=Basic_Scripting , which provides a similar syntax using the colon (:) operator.
source to share