to close line 1 error

FastestThingAlive

nrrooooommmm
so i have been trying to do something for a mod but im getting this error
Screenshot_20240113-141758.png

heres my code
Code:
local function BetterAmy(player)
if player.mo.skin ~= "amy" then
return
end

if player.mo.state == S_PLAY_MELEE_LANGING then
P_SetObjectMomZ(player.mo, 17*FRACUNIT)
S_StartSound(player.mo, sfx_s3k5f)
player.mo.state = S_PLAY_JUMP
player.pflags = $ + PF_JUMPED
end
 
It might be because + doesn't need to be used for PF_JUMPED, just make it be player.pflags = $|PF_JUMPED, since it enables it.
 
Remember to indent your code. You usually want to tabulate everything between an if and an end (you can use spaces too).

1705177926184.png

You are missing an end to close off the function at line 1.

Also yes, that player.pflags line will cause issues (not the issue you're getting right now, that's something else).
To properly enable a flag, use | instead of +.


Keep in mind that this function alone is not going to do anything meaningful. You still need to make it a hook.
 
do i do it like local function end BetterAmy (player)
Remember to indent your code. You usually want to tabulate everything between an if and an end (you can use spaces too).

View attachment 109014
You are missing an end to close off the function at line 1.

Also yes, that player.pflags line will cause issues (not the issue you're getting right now, that's something else).
To properly enable a flag, use | instead of +.


Keep in mind that this function alone is not going to do anything meaningful. You still need to make it a hook.
 
more like this


you have to enclose the contents of the function between function and end so Lua knows what to do when it gets called

if you close it way too early, like local function end BetterAmy, Lua will have no code to run whatsoever. also it will error because it's bad syntax anyways (function name declaration goes before the corresponding end)
 
more like this
View attachment 109021

you have to enclose the contents of the function between function and end so Lua knows what to do when it gets called

if you close it way too early, like local function end BetterAmy, Lua will have no code to run whatsoever. also it will error because it's bad syntax anyways (function name declaration goes before the corresponding end)
sry that im being dumb but what are the red things that look like ( ?
 
it's just a feature my text editor has, it's not something important for scripting

what is important is writing code that does the thing it is set out to do



OH WAIT, i just realized after posting that you meant the red lines i drew on top of the script
1705259506046.png

i was trying to showcase how every block opening keyword (like the word if) had a corresponding block closing keyword (like the word end) somewhere after it, and i did so by connecting them with a red line

the word function opens another block, but as you could see there was no end to that one, so i wrote a few question marks to the side instead of connecting it to something that wasn't there
then i erased the lines and wrote in the end that was missing
 
Last edited:


at least try to actually fix your code before you ask anybody to write code for you
you were told what to do and how to go about it
 
:(
Post automatically merged:

oh and i cant make sprites cuz i cant view lmps
You would need to have SLADE3 (or just SLADE) which is a Doom editor used to open and edit files like wads or pk3s, it can only run on operating systems such as Windows, MacOS and Linux.


Lmp files are also png files converted into those type of files that are under a color palette of any game set by the user.
 
i cant use slade on my chromebook (yes, i use a chromebook) becuase it used to have linix suport, now it dosnet for no reason

WAIT, "Lmp files are also png files converted into those type of files that are under a color palette of any game set by the user." does this mean i can rename lmps to png and it will work?

P.S: out of all things my android file opener can open pk3s, yay!!!!!
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top