Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make a key bind for a custom script?

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.