E to equip tool

it’s in a local script now, i dont know what else to do because I’m still learning how to fire events

I have made a remoteevent inside replicatedstorage called “Grab”
i also made a script inside sss and it looks like this:

local event = game.ReplicatedStorage.Grab
event:FireClient()

but i dont know what to do now

then noone responds again ; )

Summary

pls help

u can do

game:GetService("UserInputService").InputBegan:Connect(function(key, p)

if p then return end

if key.KeyCode == Enum.KeyCode.E then
      if gui.Enabled == true then
      local tool = tool:Clone()
      tool.Parent = game:GetService("Players").LocalPlayer.Backpack
      else
     return
      end
end

end)


i typed this on phone and if i made a mistake im srry :slight_smile:

This is kinda like a idea of what ur trying to do

Thanks, but I think I remember what to do now.

(Sorry for the bump to this topic.)

local UIS = game:WaitForChild("UserInputService")
local EKeyCode = Enum.KeyCode.E
local Tool = game.StarterPack["Your Tool Name"] -- Or do script.Parent if you want.

local function OnEquipped(_mouse)

end

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == EKeyCode then
		game.StarterPack.Katana.Equipped:Connect(OnEquipped)
	end
end)