Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(This got deleted) How to add a reload button to my gun for mobile players?

Asked by 4 years ago
Edited 4 years ago

I have this gun script and when I test it, only PC players can reload. I tried ContextActionService with no luck, and I tried a mobile-only GUI, which also had no luck.

This is the reloading part:

function onKeyDown(key,mouse)
    key=key:lower()
    if key=="r" or script.Parent.Name == "Assault Rifle [0]" and not reloading then
        reload(mouse)
    end
end

reloading is a variable.

The whole script is here.

https://pastebin.com/LK6Crvih

0
This was deleted because I deleted it :/ JoshGamingHQ1 43 — 4y
0
The only way to do this is through ContextActionService, I recommend you look at the API reference and or watch some tutorials on youtube to try and find out why it wasn't working. Shrilleh 68 — 4y
0
keydown is deprecated p0vd 207 — 4y

Answer this question