local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local CombatEnabled = false
UserInputService.InputBegan:Connect(function(Input,IsTyping)
if not IsTyping then
if Input.KeyCode == Enum.KeyCode.E then
CombatEnabled = true
end
end
end)
spawn(function()
while CombatEnabled == true do
wait(0.1)
print("Combat Enabled!")
if CombatEnabled == false then
print("Combat Disabled")
break
end
end
end)
UserInputService.InputEnded:Connect(function(Input, IsTyping)
if not IsTyping then
if Input.KeyCode == Enum.KeyCode.E then
CombatEnabled = false
end
end
end)
This local script is inside the starterpack, and there are no errors in the output.
