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

It doesnt print in output after i press x??

Whenever i press x it doesnt print worked?? I also have a Remote event called LightStart in ReplicatedStorage.

local repstore = game:WaitForChild("ReplicatedStorage")
local Remote = repstore:WaitForChild("LightStart")



local player = game.Players.LocalPlayer


mouse = player:GetMouse()
Cool = true


mouse.KeyDown:Connect(function(key)
	key = key:lower()
	if key == "x" then
		if Cool == true then return end
		Cool = false
		Remote:FireServer(mouse.Hit)
	
	
		print("Worked")
			
		wait(1)
		Cool = true
	
	
	end


end)

1 comment

0

Don't use KeyDown. Use UserInputService or ContextActionService.

1 answer

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