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

how do i use scroll mouse to equip weapons?

Asked by 7 years ago

I know how to check if a player pressed a certain key,but I dont know what scroll is called. Also i don't know how you make it so that u could use scroll to equip different weapons, like it is in for example phantom forces. Is there anyone that could please help me out and give me some instructions or ideas on how to script this?

1 answer

Log in to vote
3
Answered by 7 years ago
Edited 7 years ago

http://wiki.roblox.com/index.php?title=API:Class/Mouse/WheelForward http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan http://wiki.roblox.com/index.php?title=API:Class/Humanoid http://wiki.roblox.com/index.php?title=API:Class/Humanoid/EquipTool http://wiki.roblox.com/index.php?title=API:Class/Humanoid/UnequipTools

Well, let's first sort out what you need. You need a script that, when you scroll in or out, changes the current tool that the player is using. I'm not sure it'll work, but this is how I would go about it:

First, create a local script. I'm not sure, but I'd be willing to bet you'd have to use a remotefunction for this, if you use FilteringEnabled, but for now, I guess we'll just assume you aren't (though, it would be a very good idea to use FE, from what I understand).

Of course, you'll want to use UserInputService and InputBegan, KeyDown is deprecated, I think.

You'll also need to force the player to equip the tool, which can be done using EquipTool() and UnequipTool(). You'll also want to use a table to store your weapons. Hopefully this gives you a couple ideas on how you can go about this! Good luck!

0
Thanks a lot man! Really appreciate your help. :) blacksmiley0 19 — 7y
Ad

Answer this question