Hi, im new to roblox scripting and this is my first question :)

I have a problem to call the weapon when i want to equip the weapon as i dont know the code for it to be called

repeat wait() until game.Players.LocalPlayer

m = game.Players.LocalPlayer:GetMouse()

m.KeyDown:connect(function(key) if key == "m" then -- i want the Weapon to be equip with the character when holding this print("Equip")

end end)

m.KeyUp:connect(function(key) if key == "m" then -- the weapon will be gone if key up print("Unequip") end end)

this is the basic code that i wrote. I'm sorry, but i dont know how to code a hotkey when i want to bring out the weapon. :( can you please help

5 comments

0
0

im sorry, i'll try again

0

Give us a script.

0

There

0

Use UserInputService or ContextActionService for player input.