How to change the SpinItem with LUA?

Status
Not open for further replies.

Elyos03

↑↑↓↓←→←→ B A START
Seriously. I want to know. The stuff that SkyLua has the power to change the Colorful Rails into Ghost Images. Changing the Spin Item does not work when you try that with the Vanilla Characters. Only LUA can do this. Will you help me? I'm not very intelligent with LUA.
 
Code:
addHook("MobjThinker", function(mobj)
local player = mobj.player
		if not player.mo
		or not player.playerstate == PST_LIVE
			return
		end

		if player.mo.skin == "sonic"
			if player.spinitem == MT_THOK
				player.spinitem = 0
			end
		end
end, MT_PLAYER)

Good. but that's an example of MT_THOK. Can you explain me how to use MT_NULL with this?
 
Good. but that's an example of MT_THOK. Can you explain me how to use MT_NULL with this?

Just change player.spinitem to MT_NULL directly. MPC is silly and used 0 instead in his script for some reason (technically they're the same value, but still).
 
Just change player.spinitem to MT_NULL directly. MPC is silly and used 0 instead in his script for some reason (technically they're the same value, but still).

That didn't even work. Just put the code to me with MT_NULL. I tried to do your example but it's till exactly the same rail.
 
Oh wait, are you trying to change the trail for when the player is charging a spindash too? Change player.revitem to MT_NULL too in that case. Or if you want thok to not have a trail, change player.thokitem as well.
 
Oh wait, are you trying to change the trail for when the player is charging a spindash too? Change player.revitem to MT_NULL too in that case. Or if you want thok to not have a trail, change player.thokitem as well.

Writing an How-To like this make harder to undertand to do it. Just send me the Script with MT_NULL. Not to teach me. I couldn't undertand what to do. I just want the Script with MT_NULL for the Spin and Rev Items! Gosh!
 
Last edited:
Hey, we won't always be here to give you already fully baked scripts, you gotta learn Lua a day or another!

Code:
addHook("ThinkFrame", do // open our hook here. ThinkFrame executes it once per frame.
	for player in players.iterate // our script interacts with players, so we need this.

		if player.mo.skin == "sonic" // change to whatever skin you want to disable the spindash trail to. Remove it WITH THE END THAT STOPS THE SKIN CHECK if you want it always active.
			player.revitem = MT_NULL // disable revitem
			player.spinitem = MT_NULL // disable spinitem
		end // end our player skin check
	end // end our player iteration
end) // end the Hook and close it, hence the bracket.

This might be what you want. The script is also commented so you can understand what's going on, but it's better that you go learn Lua, and check the srb2 wiki first; pretty much everything you need is on there.
 
Writing an How-To like this make harder to undertand to do it. Just send me the Script with MT_NULL. Not to teach me. I couldn't undertand what to do. I just want the Script with MT_NULL for the Spin and Rev Items! Gosh!
If this is your response to advice then you honestly shouldn't be trying to make mods. If someone gives you advice that you don't understand, it's much better to ask them to explain the parts you're having trouble with. Simply providing you with a canned script to solve your problem is actually the worst thing we could do; it inconveniences you by creating a dependency on the community to solve very similar problems for you in the future, and also inconveniences us because we'll be solving the same problems over and over again, taking up time that could've been spent working on other projects.
 
Status
Not open for further replies.

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

Back
Top