Scriping help

Status
Not open for further replies.

Bigadre

the fox
Code:
addHook("ThinkFrame", function()
	for player in players.iterate do
		if player.mo.skin ~= "Euphorica" then
			continue
			
					if not (player.cmd.buttons & BT_CUSTOM1) then
			player.objspawntapready = true
			player.objspawntapping = false
		elseif player.objspawntapready then
			player.objspawntapping = true
			player.objspawntapready = false
		else
			player.objspawntapping = false
		end
 
		if player.objspawntapping then -- New line
			player.spawnedspring = P_SpawnMobj(player.mo.x+FixedMul(0*FRACUNIT, cos(player.mo.angle)), -- New line
					player.mo.y+FixedMul(0*FRACUNIT, sin(player.mo.angle)), player.mo.z, MT_BLUESPRING)
		end -- New line
	end
end)

i may need help .-.
 
i may need help .-.
With?

I assume you're getting an error - Before "end -- New line" an assignment operator is missing. If you're setting player.mo.y to something else, you need an equal sign instead of a plus before FixedMul.

EDIT after reading the reply below: haha whoops i don't know how did i miss that, my b
 
Last edited:
- I assume you're getting an error - Before "end -- New line" an assignment operator is missing. If you're setting player.mo.y to something else, you need an equal sign instead of a plus before FixedMul.
That line is part of the arguments for P_SpawnMobj in the above line. Note that in said "above line", there are 3 ('s but only 2 )'s, while in said "that line", there are 2 ('s but 3 )'s.
Regardless, both of the FixedMul's in the P_SpawnMobj multiply something by 0, so the entire FixedMul functions might as well just be removed (as well as the plusses in front of them).
 
Assuming this is a player ability for a Euphorica character, I think you may just be missing an "end" after "continue".

Also, player.mo.skin is always composed of lowercase letters, so you should un-capitalize "Euphorica" (replace it with "euphorica").
 
I'm just getting this error now:
WARNING: ./DOWNLOAD/Euphorica.wad|LUA_SPRI:22: ')' expected (to close '(' at line 1) near '<eof>'
Loading main config from ./DOWNLOAD/Euphorica.wad


Code:
addHook("ThinkFrame", function()
	for player in players.iterate do
		if player.mo.skin ~= "euphorica" then
			continue
				end
			
					if not (player.cmd.buttons & BT_CUSTOM1) then
			player.objspawntapready = true
			player.objspawntapping = false
		elseif player.objspawntapready then
			player.objspawntapping = true
			player.objspawntapready = false
		else
			player.objspawntapping = false
		end
 
		if player.objspawntapping then -- New line
			player.spawnedspring = P_SpawnMobj(player.mo.x, -- New line
					player.mo.y, player.mo.z, MT_BLUESPRING)
		end -- New line
	end
end
 
Last edited:
Status
Not open for further replies.

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

Back
Top