is There a way to put less cooldown in this i want it to work like on cuphead but now it just shots really slowly

redhot69

amongus
addHook("PlayerThink", function(p)
if not p.mo or p.mo.skin ~= "sonic" then return end

if p.shotCooldown == nil then
p.shotCooldown = 0
end
if p.lastShotTime == nil then
p.lastShotTime = 0
end

if p.shotCooldown == 0 and (p.cmd.buttons & BT_CUSTOM1) then
local x = p.mo.x
local y = p.mo.y
local z = p.mo.z + 30*FRACUNIT

local proj = P_SpawnMobj(x, y, z, MT_REDRING)
if proj then
proj.angle = p.mo.angle
proj.target = p.mo
P_InstaThrust(proj, proj.angle, 30*FRACUNIT)
proj.flags = $ & ~MF_BOUNCE
end

p.shotCooldown = 1
p.lastShotTime = leveltime + TICRATE
end

if p.shotCooldown > 0 and leveltime >= p.lastShotTime then
p.shotCooldown = 0
end
end)

addHook("PlayerSpawn", function(p)
p.shotCooldown = 0
p.lastShotTime = 0
end)
 
Like I said in the previous thread about this, you can change the value that's being added to p.lastShotTime to change how long the cooldown lasts.
If you want it to be around Cuphead levels, I suggest TICRATE/5, such that it fires 5 shots per second.
 
Like I said in the previous thread about this, you can change the value that's being added to p.lastShotTime to change how long the cooldown lasts.
If you want it to be around Cuphead levels, I suggest TICRATE/5, such that it fires 5 shots per second.
oh thank you so much
 

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

Back
Top