So I have 2 scripts one sets a boolvalue to true while holding down "ctrl" and one that only works when the value is set to true and it activates if you click "v" aswell, it kills the player.
script1: Player = game.Players.LocalPlayer Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if key:byte() == 50 then print("keypressed") script.Value.Value = true end end) Mouse.KeyUp:connect(function(key) if key:byte() == 50 then script.Value.Value = false print("keyunpressed") end end)
script2: Player = game.Players.LocalPlayer Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if script.Parent.AntiCP.Value.Value == true then if key:byte() == 118 then repeat wait() until Player.Character Character = Player.Character Character.Humanoid.Health = 0 print("keypressed") end end end)
It will work fine when I don't type in the chat, but while trying to copy paste in the chat it won't work.