Dude, did you really have to say that? First of all your red ring script also involves the jump thok and the red rings auto homes into enimies, thats nothing like yours. Second, even if you owned red ringslingers (which you don't) he has the right to do so because you made it reusable.You just making my mod but its bad ._ .
Don't come to a Help thread if you can't actually offer help. No one necessarily knows what you have in the making and shooting a red ring isn't exactly an original concept if you're going to say you came up with it beforehand. This is a 100% unwelcome attitude and I don't want to see it from you again.You just making my mod but its bad ._ .
You are likely to get faster help if you post your code directly instead of embedding the PK3. The MB supports syntax highlighting for Lua.Yeah, an ability for my mod. Its not working? I am trying to make it so when u tap spin, u throw a red ring:
addHook("PlayerThink", function(p)
print("Hello world!")
)
Oh ok I didn't know. Here is the codeYou are likely to get faster help if you post your code directly instead of embedding the PK3. The MB supports syntax highlighting for Lua.
Lua:addHook("PlayerThink", function(p) print("Hello world!") )
addHook("ThinkFrame", function()
for player in players.iterate do
if player.mo.skin ~= "sonic" then
continue
end
if not (player.cmd.buttons & BT_USE) then
player.spintapready = true
player.spintapping = false
elseif player.spintapready then
player.spintapping = true
player.spintapready = false
else
player.spintapping = false
end
if player.spintapping then
P_SpawnMobj(player.mo, player.target, MT_REDRING)
end
end
end)
According to the wiki,Lua:P_SpawnMobj(player.mo, player.target, MT_REDRING)
P_SpawnMobj
takes four arguments: the X, Y and Z coordinates to spawn the object, and the type of the object to spawn. You are giving the wrong count and type of arguments, hence the error. Though even if you gave the correct arguments, since the red ring is a projectile, it would hurt you on spawn since it has no assigned target. A function that would solve this instead is P_SpawnMissile
.Again, where's the code and your changes.so I fixed it and changed it to P_SpawnMissile and another error, I need to get good at coding
View attachment 46861I put it on my character mod as an example.
This part of the code is a bit broken - BT_USE is not a valid button constant anymore. Use BT_SPIN instead.Lua:if not (player.cmd.buttons & BT_USE) then player.spintapready = true player.spintapping = false elseif player.spintapready then player.spintapping = true player.spintapready = false else player.spintapping = false end
You have to set player.target first.Lua:P_SpawnMissile(player.mo, player.target, MT_REDRING) -- I think that's how you did it?
player.target = P_LookForEnemies(player)
if player.spintapping and player.target then
P_SpawnMissile(player.mo, player.target, MT_REDRING) -- This is the only line you have of this.
-- Oh yeah you can highlight lines.
end
how do I do that?You have to set player.target first.
I'd do it like so'd do it like so:player.target = P_LookForEnemies(player) if player.spintapping and player.target then P_SpawnMissile(player.mo, player.target, MT_REDRING) -- This is the only line you have of this. end
I literally just provided an examp-how do I do that?
sorry, I was tired, I didn't read that lol. I should read next timeI literally just provided an examp-
addHook("PlayerThink",function(player,target)
if player.mo.skin == "sonic"
player.target = P_LookForEnemies(player, true)
if not P_IsObjectOnGround(player.mo) and if player.target and if player.mo.state = S_PLAY_THOK
P_HomingAttack(player.mo, player.target)
P_Thrust(player.mo, player.mo.angle,30*FRACUNIT)
player.mo.state = S_PLAY_JUMP
end
end
end
end)
Lua:
addHook("PlayerThink",function(player,target)
if player.mo.skin == "sonic"
player.target = P_LookForEnemies(player, true)
if not P_IsObjectOnGround(player.mo) and not (player.pflags & PF_THOKKED)
P_HomingAttack(player.mo, player.target)
P_Thrust(player.mo, player.mo.angle,30*FRACUNIT)
player.mo.state = S_PLAY_JUMP
end
end
end
end)
addHook("JumpSpecial", function(player)
if player.mo.skin == "lightsonic"
if not P_IsObjectOnGround(player.mo)
and not (player.pflags & PF_THOKKED)
player.pflags = $1 & ~PF_JUMPED
P_Thrust(player.mo, player.mo.angle, 34*FRACUNIT)
S_StartSound(player.mo, sfx_zoom)
player.mo.state = S_PLAY_ROLL
player.pflags = $1|PF_THOKKED
end
end
end)
addHook("PlayerThink",function(player,target)
if player.mo.skin == "lightsonic"
player.target = P_LookForEnemies(player, true)
if not P_IsObjectOnGround(player.mo) and (player.pflags & PF_THOKKED)
P_HomingAttack(player.mo, player.target)
P_Thrust(player.mo, player.mo.angle,30*FRACUNIT)
player.mo.state = S_PLAY_THOK
end
end
end)