So i want that if you scroll forward / backward you change your gun to the next gun so if u have 2 guns if u have the main selected and if u scroll then it changes to ur secondary and then if u scroll again it goes back to ur main! code:
local Player = game:GetService("Players").LocalPlayer; local Backpack = Player:WaitForChild("Backpack"); local Mouse = Player:GetMouse(); local text = "Changing Weapon"; local Character = Player.Character; local Hum = Character:WaitForChild("Humanoid") local ChangeWeapon = function() print(text); local Guns = Backpack:GetChildren(); for i=1, #Guns do Hum:EquipTool(Guns[1]); end end local ChangeWeapon1 = function() print(text); local Guns = Backpack:GetChildren(); for i=-1, #Guns do Hum:EquipTool(Guns[1]); end end Mouse.WheelForward:connect(function() ChangeWeapon() end); Mouse.WheelBackward:connect(function() ChangeWeapon() end);
this does not work! D: (asking again since it got moderated =,=)
Closed as Non-Descriptive by Goulstem
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?