I am using a script for a group game, and I was wondering how I add a custom keybind to it. For example, when you press b the script activates.
You could use remote events.
For example...
Script1, ServerScriptService
game.Players.PlayerAdded:Connect(function() game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player) Instance.new("Part", workspace) end) end)
Script2 (local script) , Starterpack
local player = game.Players.LocalPlayer local REvent = game.ReplicatedStorage.RemoteEvent local mouse = player:GetMouse() mouse.KeyDown:connect(function(key) if key == "z" then REvent:FireServer() end end)