“<eof>”第 20 行预计在 'function' 附近
'<eof>' line 20 expected near 'function'
我的 Lua 脚本有错误,你可以自己看 所以这是脚本
function opponentNoteHit()
health = getProperty('health')
if getProperty('health') > 0.05 then
setProperty('health', health- 0.02);
end
end
function onCreate()
--Adds Lua Sprites
addCharacterToList('yotsugameoverscreen', 'boyfriend');
makeAnimatedLuaSprite('yotsugameoverscreen', 'yotsugameoverscreen');
luaSpriteAddAnimationByPrefix('yotsugameoverscreen', 'missyotright', 'miss_yot_right', 24, false)
luaSpriteAddAnimationByPrefix('yotsugameoverscreen', 'missyotright', 'miss_yot_right', 24, true)
luaSpriteAddAnimationByPrefix('yotsugameoverscreen', 'yotidle', 'yot_idle', 24, false)
end
return Function_Continue
function onCreate()
setPropertyFromClass('GameOverSubstate','characterName', 'yotsugameoverscreen'); --Character json file for the death animation
end
错误是“”第 20 行预计在 'function'
附近
return
是代码块中的最后一条语句。你不能在它之后定义一个函数,如
return Function_Continue
function onCreate()
setPropertyFromClass('GameOverSubstate','characterName', 'yotsugameoverscreen'); --Character json file for the death animation
end
如果你想跳过函数定义你可以这样做
do return Function_Continue end
我不知道您要做什么,但仅有的其他两个选项是将 return Function_Continue
移至文件末尾或其中一个函数。
也许您只是把 end
放在了错误的行中?
我的 Lua 脚本有错误,你可以自己看 所以这是脚本
function opponentNoteHit()
health = getProperty('health')
if getProperty('health') > 0.05 then
setProperty('health', health- 0.02);
end
end
function onCreate()
--Adds Lua Sprites
addCharacterToList('yotsugameoverscreen', 'boyfriend');
makeAnimatedLuaSprite('yotsugameoverscreen', 'yotsugameoverscreen');
luaSpriteAddAnimationByPrefix('yotsugameoverscreen', 'missyotright', 'miss_yot_right', 24, false)
luaSpriteAddAnimationByPrefix('yotsugameoverscreen', 'missyotright', 'miss_yot_right', 24, true)
luaSpriteAddAnimationByPrefix('yotsugameoverscreen', 'yotidle', 'yot_idle', 24, false)
end
return Function_Continue
function onCreate()
setPropertyFromClass('GameOverSubstate','characterName', 'yotsugameoverscreen'); --Character json file for the death animation
end
错误是“”第 20 行预计在 'function'
附近return
是代码块中的最后一条语句。你不能在它之后定义一个函数,如
return Function_Continue
function onCreate()
setPropertyFromClass('GameOverSubstate','characterName', 'yotsugameoverscreen'); --Character json file for the death animation
end
如果你想跳过函数定义你可以这样做
do return Function_Continue end
我不知道您要做什么,但仅有的其他两个选项是将 return Function_Continue
移至文件末尾或其中一个函数。
也许您只是把 end
放在了错误的行中?