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

Why will the FE script stop when I press another button?

Ok so I would have 1 tool. I would put to RemoteEvent in each one. If I were too press "r" it would create a brick that is black. If i press "q" I would create a brick that is red. But for some reason when I for Ex. Press "q" before "r" the black brick would appear but the red one would never. Why? Local script

--Local script--
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
local en = true--Debounce--
Tool = script.Parent


Tool.Equipped:Connect(function()
Mouse.KeyDown:connect(function(Key)
	if Key == "e" then
		if not en then return end
		en = false
		Tool.RemoteEvent:FireServer(Key)
	end
end)
end)

Local script

--Local script--
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
local en = true--Debounce--
Tool = script.Parent

Tool.Equipped:Connect(function()
Mouse.KeyDown:connect(function(Key)
	if Key == "r" then
		if not en then return end
		en = false
		Tool.RemoteEvent:FireServer(Key)
	end
end)
end)

Server script

--Server script--
script.Parent.RemoteEvent.OnServerEvent:Connect(function(Key)
	local Part = Instance.new("Part")
	Part.Parent = game.Workspace
	Part.BrickColor = BrickColor.new("Really red")
end)

Server script

--Server script--
script.Parent.RemoteEvents.OnServerEvent:Connect(function(Key)
	local Part = Instance.new("Part")
	Part.Parent = game.Workspace
	Part.BrickColor = BrickColor.new("Really black")
end)

Thanks for helping me

1 answer

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