Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I make a gun reload on IOS/Android?

So my script involves pressing the R Key.

game:GetService("UserInputService").InputBegan:connect(function(Key, Chatting)
	if Key.KeyCode == Enum.KeyCode.R and Chatting == false then
		if Clip.Value ~= ClipSize and RAmmo.Value > 0 and Equipped == true and ReloadEnabled == false then
			Reload()
		end
	end
end)

On Iphone you can't really do much.. So is it possible for automatic reload?

1 comment

1

you can either reload when a player tries to fire and his ammo is 0, or you can use contextactionservice which gives them a button

1 answer

✓ Accepted answer

There are a couple options:

  1. Do like @MachoPiggies said and add a ContextActionService

  2. Do an automatic reload when the player either has no ammo left or more preferably reload when the ammo isn't full.

This discussion is preserved as it was. New answers, comments, and votes are closed.