Discuss Scratch

Dokter_Bawbby
Scratcher
15 posts

Help With Reloading Weapons

Im Making Stealth Game but i need help with the gun reloading scripts

Basically

Ammo(24 Bullets)-Clip(6 Bullets or depemds what left in clip)

Really Like Reloading Guns In COD Other FPS Games
FUTSync
Scratcher
100+ posts

Help With Reloading Weapons

when [whatever] key pressed
set [clip] to [6]

i think?
BoBoMan1795
Scratcher
9 posts

Help With Reloading Weapons

This?
when [???] key pressed
set [reload] to [???]<[8112] = [1981]>

Last edited by BoBoMan1795 (June 27, 2015 19:17:15)

BoBoMan1795
Scratcher
9 posts

Help With Reloading Weapons

There that might work if you use
Plugin - Advanced Programing by SCRATCH TEAM
BoBoMan1795
Scratcher
9 posts

Help With Reloading Weapons

They are not really the scratch team they made the name up
Nomb317
Scratcher
74 posts

Help With Reloading Weapons

when green flag clicked
forever

if <<mouse down?> and <(Ammo) < [1]>> then

change [clips v] by (-1)
set [Ammo v] to [24]
end

end
lawless_licht
Scratcher
1 post

Help With Reloading Weapons

Nomb317 wrote:

when green flag clicked
forever

if <<mouse down?> and <(Ammo) < [1]>> then

change [clips v] by (-1)
set [Ammo v] to [24]
end

end

So, That's actually not gonna help anything, Instead try this:

Keep in mind that this is going to be put on/in your bullet sprite!
My engine is here:
https://scratch.mit.edu/projects/327613321/



when green flag clicked
set [ clip v] to [whatever number you want to fire]
set [ clip size v] to [clip]
set [ ammo v] to [whatever the max ammo limit is]
set [cooldown v] to [whatever reload time]
set [ fire rate v] to [the wait in between shots]
set [ reload speed v] to [whatever reload time]
forever
if <(cooldown) < [10]> then
change [cooldown v] by (1)
else
if <key [(whatever shooting button you want) v] pressed?> then
set [cooldown v] to (fire rate)
change [clip v] by (-1)
if <(ammo) > [1]> then
create clone of [myself v]
if <(clip) = [0]> then
set [cooldown v] to (reload speed)
change [ammo v] by (((clip) - (clip size)) * (-1))
wait (reload speed) secs
set [clip v] to (clip size)
if <not <(ammo) > [0]>> then
set [ammo v] to [0]
end
end
end
end
end
end

Last edited by lawless_licht (Sept. 8, 2019 14:56:26)

codeman1044
Scratcher
1000+ posts

Help With Reloading Weapons

Please avoid necroposting. This topic is from 2015.
meowsclesmidas1234
New Scratcher
1 post

Help With Reloading Weapons

thanks lawles itch
deck26
Scratcher
1000+ posts

Help With Reloading Weapons

meowsclesmidas1234 wrote:

thanks lawles itch
No need to necropost to thank people, it just knocks someone currently asking for help off the top page of the forum.
CoderJames1234
Scratcher
3 posts

Help With Reloading Weapons

poooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooop
RED-001
Scratcher
500+ posts

Help With Reloading Weapons

i just realized this is 7 years old lol

Last edited by RED-001 (May 11, 2022 16:10:36)

Tunde123
Scratcher
1000+ posts

Help With Reloading Weapons

American-jedi66 wrote:

CoderJames1234 wrote:

poooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooop


why
Please do not necropost.

Powered by DjangoBB