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

How do I make a "Q" and "E" Backpack Switch? [closed]

Asked by 4 years ago

Please help me. I'm Starter with Scripting and I don't know how to do this.
I want to make 2 Tools and make them switch when the Player press "Q" or "E".
oh, and sorry if my english is awful bc im brazilian :/

0
im noob JK_Games07 -13 — 4y

Closed as Not Constructive by iuclds, ScuffedAI, Xapelize, and Ziffixture

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
4 years ago

explainment at below answer:

PLEASE PUT THIS AS A LOCALSCRIPT OR IT WONT WORK!!!

keyQ = 'Q'
keyE = 'E'
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()

game:GetService("UserInputService").InputBegan:Connect(function(inputObject,gameProcessedEvent)
 if inputObject.KeyCode == Enum.KeyCode[KeyQ] then
  print(Key.."has been pressed", debug)
   -- change gear script
 end
 if inputObject.KeyCode == Enum.KeyCode[KeyE] then
  print(Key.."has been pressed", debug)
   -- change gear script
 end
end)

I'll type more later cuz i gonna sleep

Ad